Commit 18df8e97 authored by Romain Courteaud's avatar Romain Courteaud

Remove code specific to Transformation, which must be done with a interaction

workflow.
Add parameter to getVariationBaseCategoryItemList.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4278 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2faae62
...@@ -130,13 +130,6 @@ class Variated(Base): ...@@ -130,13 +130,6 @@ class Variated(Base):
if base_category_list is (): if base_category_list is ():
base_category_list = self.getVariationRangeBaseCategoryList() base_category_list = self.getVariationRangeBaseCategoryList()
self._setCategoryMembership(base_category_list,node_list,base=1) self._setCategoryMembership(base_category_list,node_list,base=1)
# If this is a Transformation, we have to update
# ranges for each subobject
for o in self.objectValues():
if o.hasVVariationBaseCategoryList():
o.setVVariationBaseCategoryList(o.getVVariationBaseCategoryList())
if o.hasQVariationBaseCategoryList():
o.setQVariationBaseCategoryList(o.getQVariationBaseCategoryList())
security.declareProtected(Permissions.ModifyPortalContent, 'setVariationCategoryList') security.declareProtected(Permissions.ModifyPortalContent, 'setVariationCategoryList')
def setVariationCategoryList(self, node_list, base_category_list = () ): def setVariationCategoryList(self, node_list, base_category_list = () ):
...@@ -175,14 +168,16 @@ class Variated(Base): ...@@ -175,14 +168,16 @@ class Variated(Base):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getVariationBaseCategoryItemList') 'getVariationBaseCategoryItemList')
def getVariationBaseCategoryItemList(self, display_id='title_or_id'): def getVariationBaseCategoryItemList(self, display_id='title_or_id',
omit_option_base_category=0):
""" """
Returns base category of the resource Returns base category of the resource
as a list of tuples (title, id). This is mostly as a list of tuples (title, id). This is mostly
useful in ERP5Form instances to generate selection useful in ERP5Form instances to generate selection
menus. menus.
""" """
variation_base_category_list = self.getVariationBaseCategoryList() variation_base_category_list = self.getVariationBaseCategoryList(
omit_option_base_category=omit_option_base_category)
result = [] result = []
for base_category in variation_base_category_list: for base_category in variation_base_category_list:
bc = self.portal_categories.resolveCategory(base_category) bc = self.portal_categories.resolveCategory(base_category)
......
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