[Erp5-report] r31319 kazuhiko - /erp5/trunk/products/ERP5/mixin/rule.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 15 18:21:51 CET 2009


Author: kazuhiko
Date: Tue Dec 15 18:21:43 2009
New Revision: 31319

URL: http://svn.erp5.org?rev=31319&view=rev
Log:
copy test() from existing Document/Rule.py that is also required in new API rules.

Modified:
    erp5/trunk/products/ERP5/mixin/rule.py

Modified: erp5/trunk/products/ERP5/mixin/rule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/rule.py?rev=31319&r1=31318&r2=31319&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/rule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/rule.py [utf8] Tue Dec 15 18:21:43 2009
@@ -83,6 +83,14 @@
                          specialise_value=self,
                          activate_kw=activate_kw)
     return context.get(id)
+
+  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)
 
   def expand(self, applied_rule, **kw):
     """




More information about the Erp5-report mailing list