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
This commit is contained in:
Cédric Krier
2024-11-13 13:19:25 +01:00
parent 52de5320f6
commit 4b5fa06b60
+1 -2
View File
@@ -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'