From 2ca28bca3430eff79955e6cb616eb1b66c7575d8 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Wed, 13 Oct 2021 12:41:09 +0000 Subject: [PATCH] [FIX] project_timesheet_holidays: take all leaves in given interval Before this commit, we search the leaves in the same interval of the public leaves. This commit searches all leaves containing the public leave in their interval to get all leaves and not create a timesheet for this public leave for an employee is already off. task-2665899 closes #79034 X-original-commit: ca6c164075d83e6bace2451888f8a2365b769e1a Part-of: odoo/odoo#79291 --- .../models/resource_calendar_leaves.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project_timesheet_holidays/models/resource_calendar_leaves.py b/addons/project_timesheet_holidays/models/resource_calendar_leaves.py index 2e949d29c8e..61e2f6feac4 100644 --- a/addons/project_timesheet_holidays/models/resource_calendar_leaves.py +++ b/addons/project_timesheet_holidays/models/resource_calendar_leaves.py @@ -101,8 +101,8 @@ class ResourceCalendarLeaves(models.Model): holidays_read_group = self.env['hr.leave'].read_group([ ('employee_id', 'in', list(employee_ids_set)), - ('date_from', '<=', min_date), - ('date_to', '>=', max_date), + ('date_from', '<=', max_date), + ('date_to', '>=', min_date), ('state', 'not in', ('cancel', 'refuse')), ], ['date_from_list:array_agg(date_from)', 'date_to_list:array_agg(date_to)', 'employee_id'], ['employee_id']) holidays_by_employee = {