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
Computing the hours of N days ran one search on the analytic lines per
day. The days computed together now share a single search, whose lines
are grouped back by employee and day.
Each day keeps its lines in the search order (``date desc, id desc``),
the order the per-day search returned them in, so the sums are the same
to the last digit.
``get_total_hours_domain`` now returns the domain of all the days of the
recordset, and ``_get_total_hours`` reads its value from the shared
search.
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>