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):
security.declareProtected(Permissions.AccessContentsInformation,
'getQuantityUnit')
def getQuantityUnit(self):
value = self.getQuantityUnitValue()
if value is not None:
return value.getCategoryRelativeUrl()
return None
result = self._getDefaultCategoryMembership('quantity_unit')
if result is None:
resource = self.getResourceValue()
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