From bea0aa0229334821f665ce2fb29eda9cd915acf4 Mon Sep 17 00:00:00 2001 From: Antoine Huvelle Date: Thu, 15 Mar 2012 15:33:40 +0100 Subject: [PATCH 1/2] [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 From 0560002844002ac8ec8c360209fb7040988a8415 Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Mon, 23 Apr 2012 10:14:07 +0200 Subject: [PATCH 2/2] [FIX] server action call: fix missed change in fetchmail, pep8 fixes bzr revid: xal@openerp.com-20120423081407-5ikteaw9cpw1gnq1 --- addons/base_action_rule/base_action_rule.py | 2 +- addons/fetchmail/fetchmail.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index f28561b179f..1b923ca4a58 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],'active_model':obj._name}) + 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 1588f63b9e7..df5c03dfb81 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], 'active_model':server.object_id.model}) + 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 @@ -217,7 +217,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)