[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
This commit is contained in:
Xavier BOL (xbo)
2021-11-02 16:59:56 +00:00
committed by Laurent Stukkens (LTU)
parent c348d596a6
commit 2ca28bca34
@@ -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 = {