-
- Downloads
[FIX] stock: do not recompute draft, done, cancel moves
Backport of commit 9ba3fc4c8767498890f7b5c4126f3bf2017efc97
Usecase to reproduce:
- Set a product with routes: MTO + Buy
- Create and valide a SO
- Cancel the delivery
- Cancel the RFQ linked
-> The delivery will be switch to confirmed state while it should remain
cancel.
It happens because the button_cancel on purchase.order call
_recompute_state on move. _recompute_state modify the state to confirm,
partially_available or available depending the reservation status.
Howver it should never be call on 'draft', 'cancel' or 'done' moves
since it would modify their state.
A fix would be to filter the set of moves in order to exclude moves that
are cancel, done or draft before using _recompute_state. However this is
easy to forget and the issue would be probably redo in the future.
A more stable fix is to add the filter in the _recompute_state directly.
closes odoo/odoo#42484
Task: 2157543
Signed-off-by:
Arnold Moyaux <amoyaux@users.noreply.github.com>
Loading
Please register or sign in to comment