[ADD]allow_negative_leave_and_allocation

This commit is contained in:
2025-04-16 15:05:12 +02:00
parent beb64d034d
commit 4a00e642e0
14 changed files with 980 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_leave_type_negative_leave" model="ir.ui.view">
<field name="name">hr.leave.type.negative.leave</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_leave" id="negative_leave"
string="Allow negative"
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_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">
<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>