Commit 292a1168 authored by Romain Courteaud's avatar Romain Courteaud

Add getVariationBaseCategoryList, which return the list of base category from

all variation related to amount.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2898 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b558242d
...@@ -101,6 +101,14 @@ class Amount(Base, Variated): ...@@ -101,6 +101,14 @@ class Amount(Base, Variated):
self._setVariationCategoryList(value) self._setVariationCategoryList(value)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'getVariationBaseCategoryList')
def getVariationBaseCategoryList(self):
"""
Return the list of base_category from all variation related to amount.
It is maybe a nonsense, but useful for correcting user errors.
"""
return [x.split('/')[0] for x in self.getVariationCategoryList()]
security.declareProtected(Permissions.AccessContentsInformation, 'getVariationValue') security.declareProtected(Permissions.AccessContentsInformation, 'getVariationValue')
def getVariationValue(self): def getVariationValue(self):
""" """
......
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