[Erp5-report] r37781 yo - /erp5/trunk/products/ERP5/Document/SimulationMovement.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Aug 13 07:29:42 CEST 2010
Author: yo
Date: Fri Aug 13 07:29:40 2010
New Revision: 37781
URL: http://svn.erp5.org?rev=37781&view=rev
Log:
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.
Modified:
erp5/trunk/products/ERP5/Document/SimulationMovement.py
Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=37781&r1=37780&r2=37781&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Fri Aug 13 07:29:40 2010
@@ -245,19 +245,18 @@ class SimulationMovement(Movement, Prope
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')
More information about the Erp5-report
mailing list