Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m33s
31 lines
1.3 KiB
XML
31 lines
1.3 KiB
XML
<odoo>
|
|
<record id="hr_leave_view_negative_leave" model="ir.ui.view">
|
|
<field name="name">hr.leave.view.negative.leave</field>
|
|
<field name="model">hr.leave</field>
|
|
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form" />
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='holiday_status_id']" position="attributes">
|
|
<!-- Pseudo-code for the domain:
|
|
if requires_allocation == 'no':
|
|
ok
|
|
elif has_valid_allocation and virtual_remaining_leaves > 0 and max_leaves > 0:
|
|
ok
|
|
elif allows_negative == True:
|
|
ok
|
|
else:
|
|
refuse
|
|
-->
|
|
<attribute name="domain">[
|
|
'|', '|',
|
|
('requires_allocation', '=', 'no'),
|
|
'&',
|
|
('has_valid_allocation', '=', True),
|
|
'&',
|
|
('virtual_remaining_leaves', '>', 0),
|
|
('max_leaves', '>', 0),
|
|
('allows_negative', '=', True)
|
|
]</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</odoo> |