From 857778fa94bfc70ea7684d37297ca76e40b87262 Mon Sep 17 00:00:00 2001 From: amoyaux Date: Wed, 23 Aug 2017 10:46:24 +0200 Subject: [PATCH] [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. --- addons/stock/models/stock_pack_operation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_pack_operation.py b/addons/stock/models/stock_pack_operation.py index 1c7251e7a80..8cdf5d5ce09 100644 --- a/addons/stock/models/stock_pack_operation.py +++ b/addons/stock/models/stock_pack_operation.py @@ -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