diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 50ebd96a3c2..b0bd624855b 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -390,7 +390,7 @@ the rule to mark CC(mail to any other person defined in actions)."), context = {} if action.server_action_id: - context.update({'active_id':obj.id, 'active_ids':[obj.id]}) + context.update({'active_id': obj.id, 'active_ids': [obj.id], 'active_model': obj._name}) self.pool.get('ir.actions.server').run(cr, uid, [action.server_action_id.id], context) write = {} diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 51702cf28fe..0c2395fa0ad 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -194,7 +194,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS strip_attachments=(not server.attach), context=context) if res_id and server.action_id: - action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]}) + action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': server.object_id.model}) imap_server.store(num, '+FLAGS', '\\Seen') cr.commit() count += 1 @@ -219,7 +219,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS strip_attachments=(not server.attach), context=context) if res_id and server.action_id: - action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]}) + action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': server.object_id.model}) pop_server.dele(num) cr.commit() logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name)