[FIX] Match reserved package should be correct

bzr revid: jco@openerp.com-20140307092953-zg05xusw9xctol8b
This commit is contained in:
Josse Colpaert 2014-03-07 10:29:53 +01:00
parent 63763ef224
commit 146f04cff0
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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