From bea0aa0229334821f665ce2fb29eda9cd915acf4 Mon Sep 17 00:00:00 2001 From: Antoine Huvelle Date: Thu, 15 Mar 2012 15:33:40 +0100 Subject: [PATCH] [IMP] changes in fetchmail and automated action to pass active_model info bzr revid: ahu@openerp.com-20120315143340-eec06wl7o1xb5oj9 --- addons/base_action_rule/base_action_rule.py | 2 +- addons/fetchmail/fetchmail.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 249fea89e0e..f28561b179f 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -389,7 +389,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 d1e23f49166..1588f63b9e7 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -192,7 +192,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