[FIX] stock: move entire pack with multiple quants

There was an error message when trying to move an entire
pack that contains multiple quants saying that every component
in the pack should be in the same location. (it the case with the
bug)

It happens because after action_done only one quant of the package is moved
to the new location and other quant still in the old location. Thus the
check fail. Also the extra move for remaining was not created.

This commit changes the get_remaining_prod_quantities on pack operation
that had a migration error between old/new api. This change returns the
correct remaining quantities and thus the extra move is created and all
quants for the pack are moved to the new location.
This commit is contained in:
amoyaux
2017-08-23 14:24:11 +02:00
parent 3b232b9eff
commit 857778fa94
+1 -1
View File
@@ -90,7 +90,7 @@ class PackOperation(models.Model):
res = self.package_id._get_all_products_quantities()
# reduce by the quantities linked to a move
for record in self.linked_move_operation_ids:
if record.move_id.product_id.id not in res:
if record.move_id.product_id not in res:
res[record.move_id.product_id] = 0
res[record.move_id.product_id] -= record.qty
return res