From 4b5fa06b606a105b735f6ef8640b41d9a4f2d50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 13 Nov 2024 13:19:25 +0100 Subject: [PATCH] Do not deactivate product in replacement wizard If the product can be deactivated, it must be deactivated using the proper method so all the operations like deleting staging and draft moves are performed. Otherwise the stock moves for the deactivated product will stay. Closes #13677 --- modules/product/product.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/product/product.py b/modules/product/product.py index e5d0955d1a..1dd331fdd7 100644 --- a/modules/product/product.py +++ b/modules/product/product.py @@ -929,9 +929,8 @@ class ProductReplace(Wizard): destination = self.ask.destination source.replaced_by = destination - if source.can_be_deactivated(): - source.active = False source.save() + self.model.deactivate_replaced([source]) return 'end'