[FIX] product : Improved the error message for UoM conversion having different category
authornep-OpenERP <nep@tinyerp.com>
Fri, 22 Jul 2011 06:39:24 +0000 (12:09 +0530)
committernep-OpenERP <nep@tinyerp.com>
Fri, 22 Jul 2011 06:39:24 +0000 (12:09 +0530)
bzr revid: nep@tinyerp.com-20110722063924-hkc1lyuq81ei67f4

addons/product/product.py

index b566ac6..c8f2db6 100644 (file)
@@ -139,7 +139,7 @@ class product_uom(osv.osv):
             context = {}
         if from_unit.category_id.id <> to_unit.category_id.id:
             if context.get('raise-exception', True):
-                raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))
+                raise osv.except_osv(_('Error !'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,))
             else:
                 return qty
         amount = qty / from_unit.factor