[FIX] project: allow subsequent update
Steps:
Say 3 existing tasks :
t0 (from which the recurrence has been created), t1, t2;
and t4 (not created yet).
When you change t0, t4 is updated as expected.
Issue:
But when you change t1, t4 doesn't take it into account.
Cause:
`ProjectTaskRecurrence._create_next_task` takes
`recurrence.task_ids[-1]` as template to create the next occurence.
Yet ProjectTask is ordered by "priority desc, sequence, id desc".
All occurrences being likely to have the same priority and sequence,
we the result ordered by id desc. So `recurrence.task_ids[-1]` has the
smallest id and so it is the oldest one.
Fix:
Take the task with the max id.
opw-3237168
closes odoo/odoo#118979
Signed-off-by:
Xavier Bol (xbo) <xbo@odoo.com>
Loading