Maintain the original reference when splitting shipments and productions
Closes #14190 (grafted from b1d2fd68d7e2b865675d7d466e8874247c76c786) --HG-- branch : 6.0
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user