Commit 40d9378a authored by Jérome Perrin's avatar Jérome Perrin

- fix getVariationRangeCategoryItemList according to interface

- add a no-op setVariationBaseCategoryList, because
  getVariationBaseCategoryList is not a standard reader anyway


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28732 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b727607
......@@ -179,6 +179,14 @@ class Amount(Base, Variated):
base_category_list.append(base_category)
return base_category_list
security.declareProtected(Permissions.ModifyPortalContent,
'setVariationBaseCategoryList')
def setVariationBaseCategoryList(self, node_list):
"""Do nothing in the case of an amount, because variation base category
list are set on the resource.
"""
pass
security.declareProtected(Permissions.AccessContentsInformation,
'getVariationBaseCategoryItemList')
def getVariationBaseCategoryItemList(self,display_id='getTitleOrId',**kw):
......@@ -212,9 +220,10 @@ class Amount(Base, Variated):
self._setVariationValue(variation_value)
self.reindexObject()
security.declareProtected(Permissions.AccessContentsInformation, \
security.declareProtected(Permissions.AccessContentsInformation,
'getVariationRangeCategoryItemList')
def getVariationRangeCategoryItemList(self, **kw):
def getVariationRangeCategoryItemList(self, base_category_list=(),
display_id='getTitleOrId', base=1, current_category=None, **kw):
"""
Returns possible variation category values for the
order line according to the default resource.
......@@ -225,8 +234,12 @@ class Amount(Base, Variated):
"""
resource = self.getResourceValue()
if resource is not None:
kw['omit_individual_variation'] = 0
result = resource.getVariationCategoryItemList(
omit_individual_variation=0,**kw)
base_category_list=base_category_list,
display_id=display_id,
base=base,
current_category=current_category, **kw)
else:
result = []
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