Commit f6cde1bb authored by Aurel's avatar Aurel

revert my previous commit for now as it makes many tests fail


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31284 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8279905d
...@@ -130,30 +130,23 @@ class TradeCondition(Path, Transformation, XMLMatrix): ...@@ -130,30 +130,23 @@ class TradeCondition(Path, Transformation, XMLMatrix):
specialise_value_list = context.getSpecialiseValueList() specialise_value_list = context.getSpecialiseValueList()
visited_trade_condition_list = context.getSpecialiseValueList(\ visited_trade_condition_list = context.getSpecialiseValueList(\
portal_type=portal_type_list) portal_type=portal_type_list)
while len(specialise_value_list) != 0: while len(specialise_value_list) != 0:
specialise = specialise_value_list.pop(0) specialise = specialise_value_list.pop(0)
try: try:
# all children child_list = specialise.getSpecialiseValueList(\
child_specialised_value_list = specialise.getSpecialiseValueList()
# only children that match the portal_type given
child_visited_trade_condition_list = specialise.getSpecialiseValueList(\
portal_type=portal_type_list) portal_type=portal_type_list)
except AttributeError: except AttributeError:
# it is possible, that specialised object cannot be specialised # it is possible, that specialised object cannot be specialised
# anymore # anymore
continue continue
intersection = set(child_specialised_value_list).intersection(\ intersection = set(child_list).intersection(\
set(visited_trade_condition_list)) set(visited_trade_condition_list))
for model in child_specialised_value_list: for model in child_list:
# don't add model that have already been visited. This permit to
# visit all the tree and to prevent having circular dependency
if model not in intersection: if model not in intersection:
# don't add model that are already been visited. This permit to
# visit all model tree, and to not have circular dependency
specialise_value_list.append(model) specialise_value_list.append(model)
# only add those who matches the portal type given visited_trade_condition_list.append(model)
if model in child_visited_trade_condition_list:
visited_trade_condition_list.append(model)
return visited_trade_condition_list return visited_trade_condition_list
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
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