[FW][FIX] hr_holidays: fix accrual plan in hours #195514
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps
over with a maximum of 4 hours. Set accrued gain time at the start of the period
and carry-over time at start of the year.
set the start date on the first day of next year.
15 january 2026 if the allocation starts on 1 january 2025).
-> ~14 days of time off available: the max postpone amount is not applied,
the time gained is in days and not in hours and more than 1 day is gained/month
(balance a few days after the start of the allocation should be +1 added_value
but is more than that).
Causes:
postpone_max_days
is applied in dayseven if the accrual
added_value
is in hours and the UI showspostpone_max_days
as "Up to X hours".
get_future_leaves
returns a number of hours if the allocation is in hours, evenif the time off type is in days.
high if the start of the accrual is in the future and gain time added at the start
of the period due to cache not being invalidated.
odoo/addons/hr_holidays/models/hr_leave_allocation.py
Lines 575 to 578 in 19c7737
opw-4272315
Forward-Port-Of: #195361
Forward-Port-Of: #185699