Clear the lot when the stock move product changes

Closes #14035
This commit is contained in:
Xavi Hermoso
2025-08-08 10:38:06 +02:00
parent 74186a04c8
commit 5b7dacf3a5
+9
View File
@@ -485,6 +485,15 @@ class Move(metaclass=PoolMeta):
moves, with_childs=with_childs, grouping=grouping, pblc=pblc)
return success
@fields.depends('product', 'lot')
def on_change_product(self):
try:
super().on_change_product()
except AttributeError:
pass
if self.lot and self.lot.product != self.product:
self.lot = None
class MoveAddLots(Wizard):
__name__ = 'stock.move.add.lots'