Commit e7d06339 authored by Romain Courteaud's avatar Romain Courteaud

Removed getVariationRangeCategoryItemList, getVariationCategoryItemList.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2901 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00215e94
...@@ -33,7 +33,6 @@ from Products.CMFCore.WorkflowCore import WorkflowAction ...@@ -33,7 +33,6 @@ from Products.CMFCore.WorkflowCore import WorkflowAction
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.DeliveryLine import DeliveryLine from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5.Document.Movement import Movement from Products.ERP5.Document.Movement import Movement
from Products.CMFCategory.Renderer import Renderer
class OrderLine(DeliveryLine): class OrderLine(DeliveryLine):
""" """
...@@ -122,72 +121,3 @@ class OrderLine(DeliveryLine): ...@@ -122,72 +121,3 @@ class OrderLine(DeliveryLine):
return result[0].quantity return result[0].quantity
return None return None
# XXX Copied
security.declareProtected(Permissions.AccessContentsInformation, \
'getVariationRangeCategoryItemList')
def getVariationRangeCategoryItemList(self):
"""
Returns possible variation category values for the
order line according to the default resource.
Possible category values is provided as a list of
tuples (id, title). This is mostly
useful in ERP5Form instances to generate selection
menus.
"""
resource = self.getResourceValue()
if resource != None:
result = resource.getVariationCategoryItemList(
omit_individual_variation=0)
else:
result = []
return result
security.declareProtected(Permissions.AccessContentsInformation, \
'getVariationRangeCategoryList')
def getVariationRangeCategoryList(self):
"""
Returns possible variation category values for the
order line according to the default resource.
"""
return [x[1] for x in self.getVariationRangeCategoryItemList()]
# XXX Copied from Transformation
security.declareProtected(Permissions.AccessContentsInformation, 'getVariationCategoryItemList')
def getVariationCategoryItemList(self, base_category_list=(), base=1,
display_id='title',
current_category=None):
"""
Returns the list of possible variations
XXX Copied and modified from Variated
Result is left display.
"""
variation_category_item_list = []
if base_category_list == ():
base_category_list = self.getVariationRangeBaseCategoryList()
for base_category in base_category_list:
variation_category_list = self.getVariationCategoryList(
base_category_list=[base_category])
resource_list = [self.portal_categories.resolveCategory(x) for x in\
variation_category_list]
category_list = [x for x in resource_list \
if x.getPortalType() == 'Category']
variation_category_item_list.extend(Renderer(
is_right_display=0,
display_base_category=1,
display_none_category=0, base=base,
current_category=current_category,
display_id='logical_path').\
render(category_list))
object_list = [x for x in resource_list \
if x.getPortalType() != 'Category']
variation_category_item_list.extend(Renderer(
is_right_display=0,
display_base_category=1,
base_category=base_category,
display_none_category=0, base=base,
current_category=current_category,
display_id=display_id).\
render(object_list))
return variation_category_item_list
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