Commit 86817d40 authored by Fabien Morin's avatar Fabien Morin

findSpecialiseValueList need to know wich trade condition has been visited


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27403 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 15be37b7
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# Jean-Paul Smets-Solanes <jp@nexedi.com> # Jean-Paul Smets-Solanes <jp@nexedi.com>
# Romain Courteaud <romain@nexedi.com> # Romain Courteaud <romain@nexedi.com>
# Łukasz Nowak <luke@nexedi.com> # Łukasz Nowak <luke@nexedi.com>
# Fabien Morin <fabien@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsability of assessing all potential
...@@ -119,10 +120,12 @@ class TradeCondition(Path, Transformation): ...@@ -119,10 +120,12 @@ class TradeCondition(Path, Transformation):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'findSpecialiseValueList') 'findSpecialiseValueList')
def findSpecialiseValueList(self, context, portal_type_list=None): def findSpecialiseValueList(self, context, portal_type_list=None,
visited_trade_condition_list=None):
'''Return a list of object. The list will represent the inheritance tree. '''Return a list of object. The list will represent the inheritance tree.
It uses Breadth First Search. It uses Breadth First Search.
''' '''
if visited_trade_condition_list is None:
visited_trade_condition_list = [] visited_trade_condition_list = []
specialise_value_list = [] specialise_value_list = []
if portal_type_list is None: if portal_type_list is None:
...@@ -135,7 +138,8 @@ class TradeCondition(Path, Transformation): ...@@ -135,7 +138,8 @@ class TradeCondition(Path, Transformation):
raise CircularException raise CircularException
visited_trade_condition_list.append(specialise) visited_trade_condition_list.append(specialise)
specialise_value_list.extend(self.findSpecialiseValueList(context=specialise, specialise_value_list.extend(self.findSpecialiseValueList(context=specialise,
portal_type_list=portal_type_list)) portal_type_list=portal_type_list,
visited_trade_condition_list=visited_trade_condition_list))
return specialise_value_list return specialise_value_list
def getTradeModelLineComposedList(self, context=None, portal_type_list=None): def getTradeModelLineComposedList(self, context=None, portal_type_list=None):
......
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