From 8ac2d3557935ad0c736288718bae2d66402a17af Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Fri, 7 Mar 2014 17:15:38 +0100 Subject: [PATCH] [IMP] Use cached browse records instead of reserved_availability bzr revid: jco@openerp.com-20140307161538-pu23ueb784ldd2z4 --- addons/stock/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 55821a1a99a..aa6440dbaed 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -987,7 +987,7 @@ class stock_picking(osv.osv): continue reserved_move[move.id] = set([x.id for x in move.reserved_quant_ids]) if move.state == 'assigned': - qty = move.product_qty - move.reserved_availability + qty = move.product_qty - sum([x.qty for x in move.reserved_quant_ids]) else: qty = 0 @@ -997,7 +997,7 @@ class stock_picking(osv.osv): else: qtys_remaining[move.product_id] = qty (putaway_quants_dict, putaway_remaining_dict) = self._putaway_apply(cr, uid, picking, quants, qtys_remaining, context=context) - packages = list(set([x.package_id for x in putaway_quants_dict.keys() if x and x.package_id])) + packages = list(set([x.package_id for x in quants if x and x.package_id])) # Try to find as much as possible top-level packages that can be moved top_lvl_packages = set()