Debian Codegraph @

addons/hr_holidays_attendance/views/hr_leave_allocation_views.xml

raw
1 <?xml version='1.0' encoding='UTF-8' ?>
2 <odoo>
3 <record id="hr_attendance_holidays_hr_leave_allocation_view_form_inherit" model="ir.ui.view">
4 <field name="model">hr.leave.allocation</field>
5 <field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form" />
6 <field name="arch" type="xml">
7 <xpath expr="(//div[@name='duration_display']/span)[last()]" position="after">
8 <div class="oe_inline"
9 invisible="not employee_id or not overtime_deductible or employee_overtime &lt;= 0">
10 <field name="employee_overtime" nolabel="1" widget="float_time" class="text-success" /> Extra Hours Available
11 </div>
12 </xpath>
13 </field>
14 </record>
15
16 <record id="hr_leave_allocation_overtime_manager_view_form" model="ir.ui.view">
17 <field name="model">hr.leave.allocation</field>
18 <field name="inherit_id" ref="hr_attendance_holidays_hr_leave_allocation_view_form_inherit" />
19 <field name="mode">primary</field>
20 <field name="priority">60</field>
21 <field name="arch" type="xml">
22 <xpath expr="//header" position="attributes">
23 <attribute name="invisible">1</attribute>
24 </xpath>
25 <div name="button_box" position="attributes">
26 <attribute name="invisible">1</attribute>
27 </div>
28 <xpath expr="//field[@name='holiday_status_id']" position="attributes">
29 <attribute name="domain">[('overtime_deductible', '=', True), ('requires_allocation', '=', True)]</attribute>
30 <attribute name="options">{'no_create': True, 'no_open': True}</attribute>
31 </xpath>
32 <xpath expr="//sheet" position="after">
33 <footer>
34 <button string="Save" special="save" class="btn btn-primary" close="1" />
35 <button string="Discard" special="cancel" class="btn-secondary" close="1" />
36 </footer>
37 </xpath>
38 </field>
39 </record>
40
41 <record id="hr_leave_allocation_overtime_manager_action" model="ir.actions.act_window">
42 <field name="name">New Allocation Request</field>
43 <field name="res_model">hr.leave.allocation</field>
44 <field name="view_mode">form</field>
45 <field name="view_ids" eval="[(5, 0, 0), (0, 0, {'view_mode': 'form', 'view_id': ref('hr_leave_allocation_overtime_manager_view_form')})]"/>
46 <field name="target">new</field>
47 </record>
48 </odoo>