From bb41adb3540342bc8bb2647e7123b9c76d2d3670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 12 Apr 2014 23:46:08 +0200 Subject: [PATCH] Use _sync_inventory_to_outgoing issue3842 review5011004 --- stock.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/stock.py b/stock.py index 3a5ffd1c4b..782ffac7b1 100644 --- a/stock.py +++ b/stock.py @@ -96,18 +96,11 @@ class ShipmentOut: __name__ = 'stock.shipment.out' @classmethod - @ModelView.button - @Workflow.transition('packed') - def pack(cls, shipments): + def _sync_inventory_to_outgoing(cls, shipments): pool = Pool() Uom = pool.get('product.uom') Move = pool.get('stock.move') - - super(ShipmentOut, cls).pack(shipments) - - # Unassign move to allow update - Move.draft([m for s in shipments for m in s.outgoing_moves]) - + super(ShipmentOut, cls)._sync_inventory_to_outgoing(shipments) for shipment in shipments: outgoing_by_product = {} for move in shipment.outgoing_moves: @@ -137,8 +130,6 @@ class ShipmentOut: quantity -= out_quantity assert quantity <= 0 - Move.assign([m for s in shipments for m in s.outgoing_moves]) - class ShipmentOutReturn: __name__ = 'stock.shipment.out.return'