From 7e61c8b6f08c1ec75cd463d088ef7209881ca43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Feb 2024 11:51:00 +0100 Subject: [PATCH] Clear stock moves in staging when validating amendment Closes #12999 (grafted from abebfcfa0616585fcea20e17b9bafd6413011964) --HG-- branch : 6.0 --- modules/purchase_amendment/purchase.py | 2 +- modules/sale_amendment/sale.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/purchase_amendment/purchase.py b/modules/purchase_amendment/purchase.py index 08d1c67917..af105586d2 100644 --- a/modules/purchase_amendment/purchase.py +++ b/modules/purchase_amendment/purchase.py @@ -153,7 +153,7 @@ class Amendment(Workflow, ModelSQL, ModelView): @classmethod def _stock_moves(cls, line): for move in line.moves: - if move.state == 'draft': + if move.state in {'staging', 'draft'}: yield move diff --git a/modules/sale_amendment/sale.py b/modules/sale_amendment/sale.py index 0712c66385..93baa1113e 100644 --- a/modules/sale_amendment/sale.py +++ b/modules/sale_amendment/sale.py @@ -169,7 +169,7 @@ class Amendment(Workflow, ModelSQL, ModelView): @classmethod def _stock_moves(cls, line): for move in line.moves: - if move.state == 'draft': + if move.state in {'staging', 'draft'}: yield move