Commit 4d86cd6c authored by Yoshinori Okuji's avatar Yoshinori Okuji

Revert the previous change partly, because searchRuleList omits invalidated...

Revert the previous change partly, because searchRuleList omits invalidated rules, so even if searchRuleList does not return a rule, it can be due to the validation state instead of the result of a test method.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37781 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3e4b077c
......@@ -245,19 +245,18 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
sort_order='descending'):
reference = rule.getReference()
if reference:
applicable_rule_dict.setdefault(reference, []).append(rule)
applicable_rule_dict.setdefault(reference, rule)
for applied_rule in list(self.objectValues()):
rule = applied_rule.getSpecialiseValue()
if rule in applicable_rule_dict.get(rule.getReference(), ()) \
or applied_rule._isTreeDelivered():
if rule.test(self) or applied_rule._isTreeDelivered():
applied_rule_dict[rule.getReference()] = applied_rule
else:
self._delObject(applied_rule.getId())
for reference, rule_list in applicable_rule_dict.iteritems():
for reference, rule in applicable_rule_dict.iteritems():
if reference not in applied_rule_dict:
applied_rule = rule_list[0].constructNewAppliedRule(self, **kw)
applied_rule = rule.constructNewAppliedRule(self, **kw)
applied_rule_dict[reference] = applied_rule
self.setCausalityState('expanded')
......
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