Maintain the original reference when splitting shipments and productions

Closes #14190
(grafted from b1d2fd68d7e2b865675d7d466e8874247c76c786)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2025-12-29 15:58:40 +01:00
parent 3914212c79
commit e8a3027434
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -48,6 +48,7 @@ class Production(metaclass=PoolMeta):
while (remainder > quantity
and (count or count is None)):
productions.extend(self.copy([self], {
'reference': lambda data: data['reference'],
'quantity': quantity,
'uom': uom.id,
'inputs': None,
+6 -1
View File
@@ -193,7 +193,12 @@ class SplitShipment(Wizard):
Move.delete(
[m for m in shipment.inventory_moves if m.state == 'draft'])
shipment, = Shipment.copy([shipment], default={'moves': None})
shipment, = Shipment.copy(
[shipment],
default={
'reference': lambda data: data['reference'],
'moves': None,
})
Move.write(list(self.start.moves), {'shipment': str(shipment)})
return 'end'