From b41d6685dff790b2fbf11f79b644bceba0553b4b Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Fri, 26 Aug 2022 12:57:34 +0000 Subject: [PATCH] [FIX] hr_holidays: properly show remaining half-days Since odoo/odoo#96545 the number of half-days remaining were not correct. It was showing the number of hours as days. task-2964068 closes odoo/odoo#99055 X-original-commit: 8734ea55b4070fcc361d395923621bede94c1998 Signed-off-by: Kevin Baptiste Signed-off-by: Xavier --- addons/hr_holidays/models/hr_leave_type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py index a0e9541ff68..e80a29357b6 100644 --- a/addons/hr_holidays/models/hr_leave_type.py +++ b/addons/hr_holidays/models/hr_leave_type.py @@ -376,7 +376,7 @@ class HolidaysType(models.Model): if quantity_available <= remaining_days_allocation: search_date = future_allocation_interval[1].date() + timedelta(days=1) days_consumed['virtual_remaining_leaves'] += min(quantity_available, remaining_days_allocation) - days_consumed['max_leaves'] = allocation.number_of_days if allocation.type_request_unit == 'day' else allocation.number_of_hours_display + days_consumed['max_leaves'] = allocation.number_of_days if allocation.type_request_unit in ['day', 'half_day'] else allocation.number_of_hours_display days_consumed['remaining_leaves'] = days_consumed['max_leaves'] - days_consumed['leaves_taken'] if remaining_days_allocation >= quantity_available: break