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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 22 17:52:31 CET 2010


Author: luke
Date: Fri Jan 22 17:52:29 2010
New Revision: 31922

URL: http://svn.erp5.org?rev=31922&view=rev
Log:
 - allow to work without quantity_unit_conversion_module

quantity_unit_conversion_module can be not accessible, as it is included in
erp5_pdm business template

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=31922&r1=31921&r2=31922&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Resource.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Resource.py [utf8] Fri Jan 22 17:52:29 2010
@@ -855,7 +855,10 @@
     def _getGlobalQuantityUnitDefinitionDict(self):
       # XXX this info could be cached, as it is the same for all Resources
       result = {}
-      module = self.getPortalObject().quantity_unit_conversion_module
+      module = getattr(self.getPortalObject(),
+        'quantity_unit_conversion_module', None)
+      if module is None:
+        return result
       for definition_list in module.objectValues(portal_type= \
           'Quantity Unit Conversion Group'):
         standard_quantity_unit_uid = definition_list.getQuantityUnitUid()




More information about the Erp5-report mailing list