16.0 dev recup #5

Open
LaetitiaElabore wants to merge 10 commits from 16.0-dev-recup into 16.0
3 changed files with 20 additions and 1 deletions
Showing only changes of commit f85aab4edf - Show all commits

View File

@@ -3,7 +3,7 @@
{
"name": "allow_negative_leave_and_allocation",
"version": "16.0.1.0.0",
"version": "16.0.1.0.1",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Elabore",
@@ -23,6 +23,11 @@
"views/hr_leave_type_views.xml",
"views/hr_leave_views.xml",
],
"assets": {
'web.assets_backend': [
'allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml',
],
},
# only loaded in demonstration mode
"demo": [],
"js": [],

View File

@@ -18,3 +18,8 @@ class HolidaysType(models.Model):
for holiday_type in res:
if not holiday_type.has_valid_allocation:
holiday_type.has_valid_allocation = holiday_type.allows_negative
def _get_days_request(self):
res = super()._get_days_request()
res[1]['allows_negative'] = self.allows_negative
return res

View File

@@ -0,0 +1,9 @@
<template>
<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)
: data.virtual_leaves_taken" />
</xpath>
</t>
</template>