Manage assigned moves on add lots wizard

Closes #14804
This commit is contained in:
Sergi Almacellas Abellana committed 2026-04-23 13:36:23 +02:00
1 parent 6a9252307b
commit bbc76d4d94
1 file changed
+10 -2
+10 -2
View File
@@ -522,6 +522,11 @@ class MoveAddLots(Wizard):
'stock_lot.msg_move_add_lot_quantity',
lot_quantity=lang.format_number(lot_quantity, digits),
move_quantity=lang.format_number(move_quantity, digits)))
moves = [self.record]
state = self.record.state
self.model.write(moves, {
'state': 'draft',
})
lots = []
for line in self.start.lots:
lot = line.get_lot(self.record)
@@ -549,10 +554,13 @@ class MoveAddLots(Wizard):
self.record.save()
else:
with Transaction().set_context(_stock_move_split=True):
self.model.copy([self.record], {
moves.extend(self.model.copy([self.record], {
'quantity': line.quantity,
'lot': lot.id,
})
}))
self.model.write(moves, {
'state': state,
})
return 'end'