[IMP]allow_negative_leave_and_allocation:show remaining leaves if positives else usable leaves

This commit is contained in:
2025-08-26 15:56:58 +02:00
parent d52b8c424e
commit 385781db09
2 changed files with 4 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
{
"name": "allow_negative_leave_and_allocation",
"version": "16.0.1.0.1",
"version": "16.0.1.0.2",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Elabore",

View File

@@ -2,7 +2,9 @@
<t t-name="allow_negative_leave_and_allocation.TimeOffCard" t-inherit="hr_holidays.TimeOffCard" t-inherit-mode="extension" owl="1">
<xpath expr="//t[@t-set='duration']" position="replace">
<t t-set="duration" t-value="props.requires_allocation
? (props.data['allows_negative'] ? data.usable_remaining_leaves : data.virtual_remaining_leaves)
? (props.data['allows_negative']
? (data.virtual_remaining_leaves > 0 ? data.virtual_remaining_leaves : data.usable_remaining_leaves)
: data.virtual_remaining_leaves)
: data.virtual_leaves_taken" />
</xpath>
</t>