Commit dd9d8764 authored by Łukasz Nowak's avatar Łukasz Nowak

- 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


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31922 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7720b332
......@@ -855,7 +855,10 @@ class Resource(XMLMatrix, Variated):
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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment