summaryrefslogtreecommitdiff
path: root/ohrms_loan_accounting/views/hr_loan_acc.xml
blob: 2a34948d19ef450e9347f122d97fcdc8b17679bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="hr_loan_inherited" model="ir.ui.view">
            <field name="name">HR LOAN</field>
            <field name="model">hr.loan</field>
            <field name="inherit_id" ref="ohrms_loan.hr_loan_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//header" position="replace">
                   <header>
                       <button name="compute_installment" type="object" string="Compute Installment" class="oe_highlight"  attrs="{'invisible':[('state','in',('approve', 'refuse'))]}"/>
                        <button name="action_submit" type="object" string="Submit" states="draft" class="oe_highlight"/>
                        <button name="action_cancel" type="object" string="Cancel" states="draft" />
                        <button name="action_approve" type="object" string="Approve" states="waiting_approval_1" class="oe_highlight" groups="hr.group_hr_manager,hr.group_hr_user"/>
                        <button name="action_double_approve" type="object" string="Approve" states="waiting_approval_2" class="oe_highlight" groups="account.group_account_user,account.group_account_manager"/>
                        <button name="action_refuse" type="object" string="Refuse" states="waiting_approval_1,waiting_approval_2" class="oe_highlight" groups="hr.group_hr_manager,hr.group_hr_user"/>
                        <field name="state" widget="statusbar" statusbar_visible="draft,waiting_approval_1,approve" />
                    </header>
                </xpath>
                <xpath expr="//field[@name='loan_amount']" position="after">
                    <field name="employee_account_id"  attrs="{'invisible':[('state', '=','draft')],'readonly':[('state','in',('approve', 'refuse'))]}"/>
                    <field name="treasury_account_id"  attrs="{'invisible':[('state', '=','draft')],'readonly':[('state','in',('approve', 'refuse'))]}"/>
                    <field name="journal_id"  attrs="{'invisible':[('state', '=','draft')],'readonly':[('state','in',('approve', 'refuse'))]}"/>
                </xpath>
            </field>
        </record>
    </data>
</odoo>