[Erp5-report] r21303 - in /erp5/trunk/products/ERP5: Document/ Tool/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 3 19:47:22 CEST 2008


Author: jm
Date: Tue Jun  3 19:47:21 2008
New Revision: 21303

URL: http://svn.erp5.org?rev=21303&view=rev
Log:
Finish r21301 (always convert in float).

Modified:
    erp5/trunk/products/ERP5/Document/Measure.py
    erp5/trunk/products/ERP5/Document/Resource.py
    erp5/trunk/products/ERP5/Tool/SimulationTool.py

Modified: erp5/trunk/products/ERP5/Document/Measure.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Measure.py?rev=21303&r1=21302&r2=21303&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Measure.py (original)
+++ erp5/trunk/products/ERP5/Document/Measure.py Tue Jun  3 19:47:21 2008
@@ -132,7 +132,7 @@
     metric_type = self.getMetricType()
     if quantity_unit is not None and metric_type and \
         quantity_unit.getParentId() == metric_type.split('/', 1)[0]:
-      return quantity_unit.getProperty('quantity')
+      return float(quantity_unit.getProperty('quantity'))
 
   security.declareProtected(AccessContentsInformation, 'getConvertedQuantity')
   def getConvertedQuantity(self, variation_list=()):
@@ -190,7 +190,7 @@
       if quantity is not None:
         quantity *= quantity_unit
         if (not default or quantity ==
-            resource.getQuantityUnitValue().getProperty('quantity')):
+            float(resource.getQuantityUnitValue().getProperty('quantity'))):
           return (uid, resource_uid, '^', metric_type_uid, quantity),
       return ()
 

Modified: erp5/trunk/products/ERP5/Document/Resource.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Resource.py?rev=21303&r1=21302&r2=21303&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Resource.py (original)
+++ erp5/trunk/products/ERP5/Document/Resource.py Tue Jun  3 19:47:21 2008
@@ -887,7 +887,7 @@
         # At this point, we know there is no default measure and we must add
         # a row for the management unit, with the resource's uid as uid, and
         # a generic metric_type.
-        quantity = quantity_unit_value.getProperty('quantity')
+        quantity = float(quantity_unit_value.getProperty('quantity'))
         metric_type_uid = self.getPortalObject().portal_categories \
                               .getCategoryUid(metric_type, 'metric_type')
         if quantity and metric_type_uid:

Modified: erp5/trunk/products/ERP5/Tool/SimulationTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/SimulationTool.py?rev=21303&r1=21302&r2=21303&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/SimulationTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/SimulationTool.py Tue Jun  3 19:47:21 2008
@@ -1222,8 +1222,8 @@
         table_alias_list=(("measure", "measure"),))
 
       if isinstance(quantity_unit, str):
-        quantity_unit = getCategory(quantity_unit,
-                                   'quantity_unit').getProperty('quantity')
+        quantity_unit = float(getCategory(quantity_unit, 'quantity_unit')
+                              .getProperty('quantity'))
 
       method = getattr(self,'get%sInventoryList' % simulation_period)
       return method(quantity_unit=quantity_unit, **kw)




More information about the Erp5-report mailing list