[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 <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
This commit is contained in:
Kevin Baptiste
2022-08-31 16:05:28 +02:00
parent 31f389b983
commit b41d6685df
+1 -1
View File
@@ -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