[ADD]allow_negative_leave_and_allocation:allow negative leave

This commit is contained in:
2024-12-17 12:14:56 +01:00
committed by Stéphan Sainléger
parent beb64d034d
commit 3b310c4f9d
10 changed files with 822 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_leave_type_negative_cap" model="ir.ui.view">
<field name="name">hr.leave.type.negative.cap</field>
<field name="model">hr.leave.type</field>
<field name="inherit_id" ref="hr_holidays.edit_holiday_status_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='allocation_validation']" position="inside">
<group>
<group name="negative_cap" id="negative_cap"
string="Negative Cap"
attrs="{'invisible':[('requires_allocation', '=', 'no')]}"
>
<field name="allows_negative" />
</group>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,22 @@
<odoo>
<record id="hr_leave_view_negative_cap" model="ir.ui.view">
<field name="name">hr.leave.view.negative.cap</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">
<attribute name="domain">[
'|',
('requires_allocation', '=', 'no'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
]</attribute>
</xpath>
</field>
</record>
</odoo>