From 65f278da984bc78e33204264ae6f6eb088d5a447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Dec 2012 21:54:38 +0100 Subject: [PATCH] Use Workflow for Stock Move review600002 --- stock.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/stock.py b/stock.py index 3a9bfb114d..9c65778fa4 100644 --- a/stock.py +++ b/stock.py @@ -89,10 +89,7 @@ class ShipmentOut: super(ShipmentOut, cls).pack(shipments) # Unassign move to allow update - Move.write([m for s in shipments for m in s.outgoing_moves - if m.state not in ('done', 'cancel')], { - 'state': 'draft', - }) + Move.draft([m for s in shipments for m in s.outgoing_moves]) for shipment in shipments: outgoing_by_product = {} @@ -123,10 +120,7 @@ class ShipmentOut: quantity -= out_quantity assert quantity <= 0 - Move.write([m for s in shipments for m in s.outgoing_moves - if m.state != 'cancel'], { - 'state': 'assigned', - }) + Move.assign([m for s in shipments for m in s.outgoing_moves]) class ShipmentOutReturn: