From 257df67d329e58211e091ce339ff0f55eb314da4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 4 Mar 2014 11:46:03 +0100 Subject: [PATCH] [FIX]stock: in fill inventory wizard, set raise-exception to False in context to avoid having error saying that the product uom category is different: this button is just a tool to help filling the inventory. Anyway, If it should pop the error, it should be on the validation, not in the button to auto-fill the inventory. bzr revid: dle@openerp.com-20140304104603-5y9rz8onsxdr43dp --- addons/stock/wizard/stock_fill_inventory.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index 2071fdd..19f24f1 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -104,15 +104,16 @@ class stock_fill_inventory(osv.osv_memory): datas = {} res[location] = {} move_ids = move_obj.search(cr, uid, ['|',('location_dest_id','=',location),('location_id','=',location),('state','=','done')], context=context) - + local_context = dict(context) + local_context['raise-exception'] = False for move in move_obj.browse(cr, uid, move_ids, context=context): lot_id = move.prodlot_id.id prod_id = move.product_id.id if move.location_dest_id.id != move.location_id.id: if move.location_dest_id.id == location: - qty = uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + qty = uom_obj._compute_qty_obj(cr, uid, move.product_uom,move.product_qty, move.product_id.uom_id, context=local_context) else: - qty = -uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + qty = -uom_obj._compute_qty_obj(cr, uid, move.product_uom,move.product_qty, move.product_id.uom_id, context=local_context) if datas.get((prod_id, lot_id)): -- 1.7.10.4