[FIX/REVERT] Product : patch for Conversion between different UoMs reverted
authorJay (Open ERP) <jvo@tinyerp.com>
Fri, 28 May 2010 06:33:43 +0000 (12:03 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Fri, 28 May 2010 06:33:43 +0000 (12:03 +0530)
lp bug: https://launchpad.net/bugs/543976 fixed

bzr revid: jvo@tinyerp.com-20100528063343-b4yczlvo8go8zycj

addons/product/product.py

index 1d291c7..718fad0 100644 (file)
@@ -114,8 +114,8 @@ class product_uom(osv.osv):
 
     def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context={}):
         if from_unit.category_id.id <> to_unit.category_id.id:
-            raise osv.except_osv(_('Warning !'),_('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))
-#            return qty
+#            raise osv.except_osv(_('Warning !'),_('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))
+            return qty
         if from_unit.factor_inv_data:
             amount = qty * from_unit.factor_inv_data
         else:
@@ -136,8 +136,8 @@ class product_uom(osv.osv):
         else:
             from_unit, to_unit = uoms[-1], uoms[0]
         if from_unit.category_id.id <> to_unit.category_id.id:
-            raise osv.except_osv(_('Warning !'),_('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))
-#            return price
+#            raise osv.except_osv(_('Warning !'),_('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))
+            return price
         if from_unit.factor_inv_data:
             amount = price / from_unit.factor_inv_data
         else: