Commit d2de3b9c authored by Nicolas Dumazet's avatar Nicolas Dumazet

getQuantityUnit: if category does not exist, return the path and not None


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37305 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f27d9966
...@@ -733,8 +733,10 @@ class Amount(Base, Variated): ...@@ -733,8 +733,10 @@ class Amount(Base, Variated):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getQuantityUnit') 'getQuantityUnit')
def getQuantityUnit(self): def getQuantityUnit(self):
value = self.getQuantityUnitValue() result = self._getDefaultCategoryMembership('quantity_unit')
if value is not None: if result is None:
return value.getCategoryRelativeUrl() resource = self.getResourceValue()
return None if resource is not None:
result = resource.getQuantityUnit()
return result
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