diff --git a/product/ERP5/Document/TradeCondition.py b/product/ERP5/Document/TradeCondition.py index 4952f17c786a1442a16201506cd1f49cdadc459a..2b6d191617bf5c46d14f4b1fc4ae13f7c930cf40 100644 --- a/product/ERP5/Document/TradeCondition.py +++ b/product/ERP5/Document/TradeCondition.py @@ -148,16 +148,15 @@ class TradeCondition(Path, Transformation, XMLMatrix): # it is possible, that specialised object cannot be specialised # anymore continue - intersection = set(child_specialised_value_list).intersection(\ + difference = set(child_specialised_value_list).difference(\ set(visited_trade_condition_list)) - for model in child_specialised_value_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: - specialise_value_list.append(model) - # only add those who matches the portal type given - if model in child_visited_trade_condition_list: - visited_trade_condition_list.append(model) + # don't add model that have already been visited. This permit to + # visit all the tree and to prevent having circular dependency + for model in difference: + specialise_value_list.append(model) + # only add those who matches the portal type given + if model in child_visited_trade_condition_list: + visited_trade_condition_list.append(model) return visited_trade_condition_list