Maintain the original reference when splitting shipments and productions
Closes #14190
This commit is contained in:
@@ -55,6 +55,7 @@ class Production(metaclass=PoolMeta):
|
||||
count -= 1
|
||||
if n_productions:
|
||||
productions.extend(self.copy([self] * n_productions, {
|
||||
'reference': lambda data: data['reference'],
|
||||
'quantity': quantity,
|
||||
'unit': unit.id,
|
||||
'inputs': None,
|
||||
|
||||
@@ -230,7 +230,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