Use _sync_inventory_to_outgoing

issue3842
review5011004
This commit is contained in:
Cédric Krier committed 2014-04-12 23:46:08 +02:00
1 parent e12df7f33a
commit bb41adb354
1 file changed
+2 -11
+2 -11
View File
@@ -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'