From 292a11684534f683e838748880e6c8f34bd8fb7f Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Mon, 18 Apr 2005 08:54:05 +0000 Subject: [PATCH] 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 --- product/ERP5/Document/Amount.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/product/ERP5/Document/Amount.py b/product/ERP5/Document/Amount.py index 19272e198b..fcbc8a528b 100755 --- a/product/ERP5/Document/Amount.py +++ b/product/ERP5/Document/Amount.py @@ -101,6 +101,14 @@ class Amount(Base, Variated): self._setVariationCategoryList(value) 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') def getVariationValue(self): """ -- 2.30.9