Commit Graph

19 Commits

Author SHA1 Message Date
Valentin Lab
567a0a1d0d [IMP]hr_employee_stats_sheet:read the public holidays once per employee
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
2026-11-19 14:09:26 +01:00
Valentin Lab
92dc0e2a58 [IMP]hr_employee_stats_sheet:read the validated leaves of all the days in one search
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
2026-11-19 14:09:25 +01:00
Valentin Lab
21cca44604 [IMP]hr_employee_stats_sheet:read the planned hours of all the days at once
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
2026-11-19 14:09:23 +01:00
Valentin Lab
12de36565a [IMP]hr_employee_stats_sheet:read the timesheet lines of all the days in one search
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
2026-11-19 14:09:06 +01:00
991fd43167 [FIX]hr_employee_stats_sheet:use employee calendar hours per day to convert recovery hours into allocation days
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>
2026-11-04 11:35:27 +01:00
872826e2eb [FIX]hr_employee_stats_sheet:remove invalid or inactive recoveries from total_recovery_hours in timesheet_sheet statistics 2026-10-16 15:19:27 +02:00
2f73c1b3a7 [FIX]hr_employee_stats_sheet:fix bug in _get_total_recovery_hours and _get_total_leave_hours for half-days request unit leaves 2026-06-16 14:36:20 +02:00
b65b6431b6 [IMP]hr_employee_stats_sheet:conciderate only valided and active leaves 2026-03-24 09:57:16 +01:00
01cf81e8bb [FIX]hr_employee_stats_sheet:fix timesheet_line_ids definition 2025-12-22 16:31:33 +01:00
e1534c41d8 [IMP]hr_employee_stats_sheet: fix leave hours when several leaves exits for the same days 2025-12-22 14:27:07 +01:00
e61e2792a9 [IMP]hr_employee_stats_sheet:make allocation automaticly starting the starting date of the associated timesheet sheet 2025-12-17 16:11:31 +01:00
9f061ff409 [CLN]hr_employee_stats_sheet:remove hr_timesheet_sheet_akretion depedencie 2025-12-17 16:06:13 +01:00
a2ebda5898 [REF]hr_employee_stats_sheet:delete max allowed recovery hours limitation 2025-12-16 14:55:43 +01:00
8ac80079a0 [IMP]hr_employee_stats_sheet:add dependecie to hr_employee_calendar_planning and identifies the planning using by a employee during a time period
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m30s
2025-12-11 16:49:40 +01:00
5b103056d6 [FIX]hr_employee_stats_sheet:fix identification of public holidays according to employee TZ 2025-12-10 14:47:42 +01:00
d2301b765e [IMP]hr_employee_stats_sheet: add dependencies to hr_timesheet_sheet_usability_misc and hr_timesheet_sheet_usability_akretion for better usability 2025-12-10 14:44:43 +01:00
c16fccfa6e [FIX]hr_employee_stats_sheet:fix calculation of planned recovery when recovery takes several days 2025-12-08 16:15:05 +01:00
004187d9a8 [FIX]hr_employee_stats_sheet:replace allow_negative_leave dependencies to hr_negative_leave module 2025-10-31 09:58:37 +01:00
fd5e0f2f44 [ADD]hr_employee_stats_sheet 2025-10-09 14:57:05 +02:00