-
- Downloads
[FIX] hr_holidays: prevent the archiving of allocations
Archiving an allocation creates bad behaviour
in the use of the time off application.
For example, an employee who has several allocations some of which are archived
in the same period will create a problem in the counting of remaining days off.
Steps to reproduce:
- for an employee;
- create a 5 days type A allocation with a validity from 01/01/2023 to 31/01/2023;
- create a 5 days type A allocation with validity from 01/01/2023;
- archive the first allowance;
- set time off for this employee in this period.
Issue:
The employee's days off are not deducted until he has taken at least 5 days off.
Cause:
The process of deciding which allocation to use first will depend
on whether it has an end date or not.
It will therefore use the allocation with an end date first
(in our case the archived one).
Solution:
Archived allocations cannot be ignored by removing them
from the calculation process, as they have a use.
The solution that respects the business flow is to prevent archiving
for allocations that are not in a draft or refuse state.
opw-2991368
closes odoo/odoo#111092
Signed-off-by:
Kevin Baptiste <kba@odoo.com>