[REF] Clean up
authorStephane Wirtel <stephane@openerp.com>
Fri, 22 Apr 2011 11:37:06 +0000 (13:37 +0200)
committerStephane Wirtel <stephane@openerp.com>
Fri, 22 Apr 2011 11:37:06 +0000 (13:37 +0200)
bzr revid: stephane@openerp.com-20110422113706-kyeoyfb79uvc5899

addons/base_action_rule/base_action_rule.py

index 2a4e2c0..869c8ea 100644 (file)
@@ -325,7 +325,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
             @param context: A standard dictionary for contextual values """
         if context is None:
             context = {}
-        ok = True 
+        ok = True
         if action.filter_id:
             if action.model_id.model == action.filter_id.model_id:
                 context.update(eval(action.filter_id.context))
@@ -445,19 +445,13 @@ the rule to mark CC(mail to any other person defined in actions)."),
             context = {}
 
         context.update({'action': True})
-        if not scrit:
-            scrit = []
 
         for action in self.browse(cr, uid, ids, context=context):
-            model_obj = self.pool.get(action.model_id.model)
             for obj in objects:
-                ok = self.do_check(cr, uid, action, obj, context=context)
-                if not ok:
-                    continue
+                if self.do_check(cr, uid, action, obj, context=context):
+                    model_obj = self.pool.get(action.model_id.model)
+                    self.do_action(cr, uid, action, model_obj, obj, context=context)
 
-                if ok:
-                    self.do_action(cr, uid, action, model_obj, obj, context)
-                    break
         context.update({'action': False})
         return True
 
@@ -480,7 +474,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
         return True
 
     _constraints = [
-        (_check_mail, 'Error: The mail is not well formated', ['act_mail_body']), 
+        (_check_mail, 'Error: The mail is not well formatted', ['act_mail_body']),
     ]
 
 base_action_rule()