Skip to content
Snippets Groups Projects
user avatar
Tommy (tong) authored
Steps to reproduce:

- Setup an accrual plan with yealy first of Jan granting 15 leaves and it will pospone maximum 7
leaves to the next year.
- Setup an allocation with date started 2 years ago on first of Jan.
- Run scheduled action "Accrual Time: Updates the number of time off" after current year first of
Jan.

Current behaviour:
Only granted 7 days leaves.

Expected behaviour:
It should grant 22 days leaves as it should combined the postpone 7 days leaves and the leaves
granted on first of Jan of the current year.

Explanation:
With this modifiation there are two changes:

1) The lastcall and nextcall in the _end_of_year_accrual method should not skipped the
_process_accrual_plans methods in the _update_accrual method for all the allocations that using
pospone action_with_unused_accruals. It should keep the lastcall as previous date of current
level or the lastcall of the allocation depending with one is latest. Also the nextcall should be
the upcoming nextcall. Therefore after the postpone_max_days caluclated. The _update_accrual
method can compute the leaves again for yearly first of Jan accrual plan.

2) The prorata amount accrual plan calculation should be date_to first_date_this_year. Otherwise
one day is missing in the prorata calculation and the leaves count will be incorrect.

closes odoo/odoo#111434

X-original-commit: 11713bfb
Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
ea53b57a
History
Name Last commit Last update