From 8f4e365ad7809629f2fd51e77def00d411fdc053 Mon Sep 17 00:00:00 2001 From: Rob Coekaerts Date: Thu, 4 May 2023 15:55:32 +0200 Subject: [PATCH] [FIX] hr_holidays: allow maternity leave during credit time During a credit time period where the employee works zero hours, the employee should still be able to take maternity leave. Before this change this was only possible if you manually set the duration of this leave for it to be non-zero, which was kind of a hack. Now that durations are computed correctly automatically, maternity (and paternity) leaves were added to the list of exceptions of leave types that can be taken even if their duration is zero. Part-of: odoo/odoo#119317 --- addons/hr_work_entry_holidays/models/hr_leave.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_work_entry_holidays/models/hr_leave.py b/addons/hr_work_entry_holidays/models/hr_leave.py index e0cc82e9b2d..4a907558cb7 100644 --- a/addons/hr_work_entry_holidays/models/hr_leave.py +++ b/addons/hr_work_entry_holidays/models/hr_leave.py @@ -206,7 +206,7 @@ Contracts: def _get_leaves_on_public_holiday(self): return super()._get_leaves_on_public_holiday().filtered( - lambda l: l.holiday_status_id.work_entry_type_id.code not in ['LEAVE110', 'LEAVE280']) + lambda l: l.holiday_status_id.work_entry_type_id.code not in ['LEAVE110', 'LEAVE210', 'LEAVE280']) def _validate_leave_request(self): super(HrLeave, self)._validate_leave_request()