Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] stock: Improve date_deadline propagation
The date_deadline propagation would update the sale records multiple times depending on some configuration (check example below). This happens because 'already_propagate_ids' is copied at the beginning of _set_date_deadline (set | set = new set). So, when a child move propagates to multiple other moves, it is not known by the parent move, which will redo the propagation. To prevent this, we always keep the same reference for 'already_propagate_ids' (context: 'date_deadline_propagate_ids'). This means that a parent and child move share the exact same Set, and when the child move updates the Set, it also updates the parent Set. So when a child move propagates, the parent will know which moves have been done. MOVES LINKAGE Move B / | \ Move A | Move D \ | / Move C PROPAGATION GRAPHS: BEFORE | AFTER ------------+-------- A | A / \ | | C B | B / \ / \ | | B D C D | C | | | | | | D B D C | D ------------+-------- 11 | 4 NUMBER OF CALLS OPW-3904178 closes odoo#164734 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Co-authored-by: Mathieu Walravens <wama@odoo.com>
- Loading branch information