From ea9740846e036b09ee671f89a618df83fc342a9e 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 --- 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 c64321d5a1..75bb9f2f21 100644 --- a/modules/purchase_amendment/purchase.py +++ b/modules/purchase_amendment/purchase.py @@ -161,7 +161,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 43353dfc0a..5758527214 100644 --- a/modules/sale_amendment/sale.py +++ b/modules/sale_amendment/sale.py @@ -177,7 +177,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