[Erp5-report] r17641 - /erp5/trunk/products/ERP5/Document/Rule.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 15 19:05:38 CET 2007


Author: alex
Date: Thu Nov 15 19:05:37 2007
New Revision: 17641

URL: http://svn.erp5.org?rev=17641&view=rev
Log:
if no test method is defined, the rule should not apply

Modified:
    erp5/trunk/products/ERP5/Document/Rule.py

Modified: erp5/trunk/products/ERP5/Document/Rule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Rule.py?rev=17641&r1=17640&r2=17641&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Rule.py (original)
+++ erp5/trunk/products/ERP5/Document/Rule.py Thu Nov 15 19:05:37 2007
@@ -119,6 +119,14 @@
     return context.get(id)
 
   # Simulation workflow
+  def test(self, *args, **kw):
+    """
+    If no test method is defined, return False, to prevent infinite loop
+    """
+    if not self.getTestMethodId():
+      return False
+    return Predicate.test(self, *args, **kw)
+
   security.declareProtected(Permissions.ModifyPortalContent, 'expand')
   def expand(self, applied_rule, **kw):
     """




More information about the Erp5-report mailing list