Test move from _get_inventory_moves before setting location

issue3530
review2011002
(transplanted from 1a68309d3de62a024703eaa2ae7a3aca79f208e6)
This commit is contained in:
Cédric Krier committed 2013-12-12 13:31:21 +01:00
1 parent 423b422f5e
commit 421de52d12
1 file changed
+6 -5
+6 -5
View File
@@ -36,11 +36,12 @@ class ShipmentIn(ModelSQL, ModelView):
def _get_inventory_moves(self, incoming_move):
res = super(ShipmentIn, self)._get_inventory_moves(incoming_move)
for product_location in incoming_move.product.locations:
if product_location.warehouse.id != \
incoming_move.shipment_in.warehouse.id:
continue
res['to_location'] = product_location.location.id
if res:
for product_location in incoming_move.product.locations:
if product_location.warehouse.id != \
incoming_move.shipment_in.warehouse.id:
continue
res['to_location'] = product_location.location.id
return res
ShipmentIn()