Delete inventory moves before receiving supplier shipments
issue9315 review315451002
This commit is contained in:
@@ -425,6 +425,8 @@ class ShipmentIn(ShipmentMixin, Workflow, ModelSQL, ModelView):
|
||||
def receive(cls, shipments):
|
||||
Move = Pool().get('stock.move')
|
||||
Move.do([m for s in shipments for m in s.incoming_moves])
|
||||
Move.delete([m for s in shipments for m in s.inventory_moves
|
||||
if m.state in ('draft', 'cancel')])
|
||||
cls.create_inventory_moves(shipments)
|
||||
# Set received state to allow done transition
|
||||
cls.write(shipments, {'state': 'received'})
|
||||
|
||||
Reference in New Issue
Block a user