Manage assigned moves on add lots wizard

Closes #14804
(grafted from 83ef4c017af5df55178fa22f7775d35fd7f28874)

--HG--
branch : 8.0
This commit is contained in:
Sergi Almacellas Abellana
2026-04-23 13:36:23 +02:00
parent f912ebc697
commit 56ec009f0b
+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'