From 206494442fb9aafbf98be5b28d2da22705af34c2 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 : 7.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 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