[Erp5-report] r21301 - /erp5/trunk/products/ERP5/Document/Resource.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 3 19:18:24 CEST 2008


Author: nicolas
Date: Tue Jun  3 19:18:23 2008
New Revision: 21301

URL: http://svn.erp5.org?rev=21301&view=rev
Log:
always convert in float

Modified:
    erp5/trunk/products/ERP5/Document/Resource.py

Modified: erp5/trunk/products/ERP5/Document/Resource.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Resource.py?rev=21301&r1=21300&r2=21301&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Resource.py (original)
+++ erp5/trunk/products/ERP5/Document/Resource.py Tue Jun  3 19:18:23 2008
@@ -794,12 +794,12 @@
       if management_unit == quantity_unit:
         return 1.0
       traverse = self.portal_categories['quantity_unit'].unrestrictedTraverse
-      quantity = traverse(quantity_unit).getProperty('quantity')
+      quantity = float(traverse(quantity_unit).getProperty('quantity'))
       if quantity_unit.split('/', 1)[0] != management_unit.split('/', 1)[0]:
         measure = self.getDefaultMeasure(quantity_unit)
         quantity /= measure.getConvertedQuantity(variation_list)
       else:
-        quantity /= traverse(management_unit).getProperty('quantity')
+        quantity /= float(traverse(management_unit).getProperty('quantity'))
       return quantity
 
     # Unit conversion




More information about the Erp5-report mailing list