From 20f9cf5dc31c7ff85044a773e71a25e173bd869c Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Thu, 14 May 2020 23:45:16 +0200 Subject: [PATCH] Delete inventory moves before receiving supplier shipments issue9315 review315451002 --- shipment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shipment.py b/shipment.py index 152ff59256..27d5e8a894 100644 --- a/shipment.py +++ b/shipment.py @@ -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'})