Currently, when we have an accrual plan where the accrued time is
allocated at the start of the accrual period and we set the allocation
start time in the past, the plan will be processed but already_accrued
will not be saved.
Example:
- We have an accrual plan that allocates 1 day per month at the start
of the accrual period. Milestone reached 0 days after allocation
start.
- We set the start date of the allocation to 2024-01-01, the current
date is 2024-03-15. The number of days are calculated to 3.00
(jan, feb, mar).
- We save the record, already_accrued is not saved (defaults to false)
- When the scheduled action runs (2024-04-01), it will allocate 2 days
instead of 1
This commit fixes this behavior by adding the already_accrued field to
the form view so that it is saved when the record is created.
opw-3851320
closesodoo/odoo#161508
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>