Commit 9f05869c authored by Kevin Deldycke's avatar Kevin Deldycke

Don't return duplicate base categories


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3247 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d8a3cbf
......@@ -147,7 +147,12 @@ class Amount(Base, Variated):
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()]
base_category_list = []
for category in self.getVariationCategoryList():
base_category = category.split('/')[0]
if base_category not in base_category_list:
base_category_list.append(base_category)
return base_category_list
security.declareProtected(Permissions.AccessContentsInformation, 'getVariationValue')
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