Files
odoo_source/addons/hr_holidays
kdeb@odoo.com 3117ba3d4a [FIX] hr_holidays: reset allocation to 0 on date change
Issue:
    - when creating an accrual plan based on attendance,
    the duration is not computed accurately when allocating.
    - the computation is not correct if you select a different
    start date in the allocation without emptying the field "Allocation"

Steps To Reproduce:
    - In the time-off app create an accrual plan:  where employee
     accrue 1h for every hour worked based on attendance.
    - In the attendance app create a new attendance for 8 hours.
    - add a new allocation to Mitchell Admin with the plan you created.
    - Change the date on the validity period, new allocation is 8h.
    - change the date again and notice the Allocation not computed correctly.

Solution:
    - In `_onchange_date_from` when simulating how many days an
    accrual plan would give from a certian `date_from` we don't reset
    `number_of_days` to 0. reseting it to 0 fixes the issue.

opw-3793961

closes odoo/odoo#160696

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-11 08:12:53 +00:00
..