summaryrefslogtreecommitdiff
path: root/addons/hr_fleet/views/employee_views.xml
blob: 67ead3b115a1b660629bcda784f45bc81f1d112e (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_employee_form" model="ir.ui.view">
        <field name="name">hr.employee.form.inherit.hr.fleet</field>
        <field name="model">hr.employee</field>
        <field name="inherit_id" ref="hr.view_employee_form" />
        <field name="arch" type="xml">
             <xpath expr="//header" position="inside">
                <button name="action_get_claim_report" string="Claim Car Report"
                class="btn btn-secondary"
                type="object" groups="fleet.fleet_group_manager"
                attrs="{'invisible': [('employee_cars_count','=', 0)]}"
                confirm="This report will contain only PDF files. If you want all documents, please go on vehicle page. Do you want to proceed?"/>
            </xpath>
            <div name="button_box" position="inside">
                <button name="action_open_employee_cars" type="object"
                        class="oe_stat_button" icon="fa-car" groups="fleet.fleet_group_manager"
                        attrs="{'invisible': [('employee_cars_count','=', 0)]}">
                    <field name="employee_cars_count" widget="statinfo" />
                </button>
            </div>
            <xpath expr="//group[@name='identification_group']" position="after">
                <group string="Fleet">
                    <field name="mobility_card"/>
                </group>
            </xpath>
        </field>
    </record>

    <record id="res_users_view_form_preferences" model="ir.ui.view">
        <field name="name">hr.user.preferences.form.inherit.hr.fleet</field>
        <field name="model">res.users</field>
        <field name="inherit_id" ref="hr.res_users_view_form_profile" />
        <field name="arch" type="xml">
             <xpath expr="//header" position="inside">
                <button name="action_get_claim_report" string="Claim Car Report"
                class="btn btn-primary"
                type="object" groups="fleet.fleet_group_manager"
                invisible="context.get('from_my_profile', False)"
                attrs="{'invisible': [('employee_cars_count','=', 0)]}"
                confirm="This report will contain only PDF files. If you want all documents, please go on vehicle page. Do you want to proceed?"/>
            </xpath>
            <xpath expr="//div[@name='button_box']" position="inside">
                <button name="action_open_employee_cars" type="object"
                        class="oe_stat_button" icon="fa-car" groups="fleet.fleet_group_manager"
                        attrs="{'invisible': [('employee_cars_count','=', 0)]}">
                    <field name="employee_cars_count" widget="statinfo" />
                </button>
            </xpath>
        </field>
    </record>
</odoo>