[IMP]: base_action_rule: Improved query to get only active rules

bzr revid: rpa@tinyerp.com-20100706134805-pnlo2ry5fjs31sj7
This commit is contained in:
rpa (Open ERP) 2010-07-06 19:18:05 +05:30
parent 1d9cbd3aae
commit 8985969fba
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ the rule to mark CC(mail to any other person defined in actions)."),
def pre_action(self, cr, uid, ids, model, context=None):
# Searching for action rules
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule LEFT JOIN ir_model model on (model.id = rule.name)")
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \
LEFT JOIN ir_model model on (model.id = rule.name) \
where active")
res = cr.fetchall()
# Check if any rule matching with current object
for obj_name, rule_id in res: