Skip to content
Snippets Groups Projects
Commit 61bbd8e6 authored by Audric Onockx (auon)'s avatar Audric Onockx (auon)
Browse files

[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: default avatarXavier Bol (xbo) <xbo@odoo.com>
parent 6a003a12
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment