From 146f04cff022861d7cd0ceb557aa9a2df686b178 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Fri, 7 Mar 2014 10:29:53 +0100 Subject: [PATCH] [FIX] Match reserved package should be correct bzr revid: jco@openerp.com-20140307092953-zg05xusw9xctol8b --- addons/stock/stock.py | 5 +++-- addons/stock_account/wizard/stock_valuation_history.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 0323aa6cc25..3dcaf7f7abf 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3582,8 +3582,9 @@ class stock_pack_operation(osv.osv): def _check_quants_reserved(ops): if ops.package_id and not ops.product_id: qty_op_rem[ops.id] = {} - for quant in self.get_contents(cr, uid, ops.package_id): - if quant.reservation_id and quant.reservation_id.id in [x.id for x in ops.picking_id.move_lines] and (not quants_done.get(quant.id)): + package_obj.get_contents(cr, uid, ops.package_id) + for quant in package_obj.get_contents(cr, uid, ops.package_id): + if quant.id in quants_done.keys() and (quants_done[quant.id] == quant.qty): #Entire packages means entire quants from those packages if not quants_done.get(quant.id): quants_done[quant.id] = 0 diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index 49eca2a97ea..614f83fde6b 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -57,6 +57,7 @@ class stock_history(osv.osv): def _get_inventory_value(self, cr, uid, ids, name, attr, context=None): product_obj = self.pool.get("product.product") res = {} + #Browse takes an immense amount of time because it seems to reload the report for line in self.browse(cr, uid, ids, context=context): if line.product_id.cost_method == 'real': res[line.id] = line.quantity * line.price_unit_on_quant