diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4059565680d..251d157dcc0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3002,7 +3002,7 @@ class stock_inventory_line(osv.osv): if res: location = self.pool['stock.location'].browse(cr, uid, values.get('location_id'), context=context) product = product_obj.browse(cr, uid, values.get('product_id'), context=context) - raise Warning(_("You cannot have two inventory adjustements in state 'in Progess' with the same product(%s), same location(%s), same package, same owner and same lot. Please first validate the first inventory adjustement with this product before creating another one.") % (product.name, location.name)) + raise UserError(_("You cannot have two inventory adjustements in state 'in Progess' with the same product(%s), same location(%s), same package, same owner and same lot. Please first validate the first inventory adjustement with this product before creating another one.") % (product.name, location.name)) if 'product_id' in values and not 'product_uom_id' in values: values['product_uom_id'] = product_obj.browse(cr, uid, values.get('product_id'), context=context).uom_id.id return super(stock_inventory_line, self).create(cr, uid, values, context=context)