changeset f3f771429e60 in modules/stock:5.4
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=f3f771429e60
description:
Delete inventory moves before receiving supplier shipments
issue9315
review315451002
(grafted from 8b69dbd9d6e1a0fc9bdee214895c6b7d1edd5b68)
diffstat:
shipment.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diffs (12 lines):
diff -r a0b09f8f961d -r f3f771429e60 shipment.py
--- a/shipment.py Mon Mar 09 18:33:52 2020 +0100
+++ b/shipment.py Thu May 14 23:45:16 2020 +0200
@@ -459,6 +459,8 @@
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'})