[FIX]hr_negative_leave:fix leave types available when creating a leave request #17

Merged
laetitiadacosta merged 1 commits from 16-fix-hr-negative-leaves into 16.0 2026-02-10 15:30:07 +00:00
2 changed files with 18 additions and 9 deletions
Showing only changes of commit 821b17fbd5 - Show all commits

View File

@@ -3,7 +3,7 @@
{
"name": "hr_negative_leave",
"version": "16.0.3.0.0",
"version": "16.0.3.0.1",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Elabore",

View File

@@ -5,16 +5,25 @@
<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'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
('max_leaves', '&gt;', 0),
('allows_negative', '=', True)
]</attribute>
</xpath>
</field>