Each day searched the public holidays of its own date. The days computed
together now run one search per employee over their date range, then
keep for each day the holidays the per-day search returned: those whose
UTC range covers the day. The check in the employee time zone is
unchanged, and two holidays on the same day still raise the same error.
With this change, the number of SQL queries needed to compute the days of
an employee no longer grows with the number of days.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: GPT:gpt-6.1-sol
Assisted-by: GPT:gpt-6.2-astra-ultrafast
Each day ran two searches on the leaves, one for the recoveries and one
for the other leaves. The days computed together now share one search,
and ``_absence_hours_by_stat`` applies the existing rule to each day: a
single-day request counts the hours Odoo computed for it, a day inside a
longer request counts the planned hours of that day.
The leaves of a day stay in the search order (``date_from desc``), so the
sums are the same as before.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: GPT:gpt-6.2-sol-ultrafast
The planned hours of each day searched the employee calendar history,
then the calendar attendances, day by day. The days computed together now
share one search of the calendar histories and one of the attendances.
The calendar of a day is chosen by the same rule as before, now in
``_select_stats_calendar`` and shared with
``_get_calendar_in_progress_during_a_time_period``: the history line
covering the day, else the company calendar, and an error when two lines
cover it.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: GPT:gpt-6.1-sol
Assisted-by: GPT:gpt-6.2-astra-ultrafast
Odoo displays allocation hours with the hours per day of the employee's
resource calendar. Converting recovery hours with another calendar (planning
calendar or company calendar) made the generated allocation display a wrong
number of hours (e.g. 18.21h instead of 19h).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>