[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
This commit is contained in:
Denis Ledoux 2014-03-04 11:46:03 +01:00
parent d105ec6e82
commit 257df67d32
1 changed files with 4 additions and 3 deletions

View File

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