From b4f3fe616ac30b5593386f29cfc170dec13c27d5 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Mon, 19 Dec 2011 11:53:43 +0100 Subject: [clean] config bzr revid: tfr@openerp.com-20111219105343-bs2udshlsza7kvj1 --- addons/plugin/plugin_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index fd5ca7da6c6..e7e8b9ea817 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -38,9 +38,9 @@ class plugin_handler(osv.osv_memory): (model_name, res_id, url, name_get) """ mail_message_obj = self.pool.get('mail.message') - model = False + model = "" res_id = 0 - url = False + url = "" name = "" msg = mail_message_obj.parse_message(email) references = [msg.get('message-id')] -- cgit v1.2.3 From 11d93b49445c960e5ecdc05180b4dae33d2be1ec Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Mon, 19 Dec 2011 12:39:30 +0100 Subject: [FIX] push email on partner bzr revid: tfr@openerp.com-20111219113930-d3k4zs40r0fcz3ib --- addons/plugin/plugin_handler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index e7e8b9ea817..3c322b67bf4 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -92,6 +92,8 @@ class plugin_handler(osv.osv_memory): msg = mail_message.parse_message(email) message_id = msg.get('message-id') mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) + if model=='res.partner': + model_obj = self.pool.get('mail.thread') if message_id and mail_ids : mail_record = mail_message.browse(cr, uid, mail_ids)[0] res_id = mail_record.res_id -- cgit v1.2.3 From 60ee12e6e1b436a20c53523ebcbb9e093a2a6284 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 20 Dec 2011 17:25:06 +0100 Subject: [FIX] plugin: correct generated url for documents bzr revid: chs@openerp.com-20111220162506-001gf9whw9jhbl82 --- addons/plugin/plugin_handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index fd5ca7da6c6..8a9f2073c2d 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -12,13 +12,14 @@ class plugin_handler(osv.osv_memory): def _make_url(self, cr, uid, res_id, model, context=None): """ - @param id: on which document the message is pushed + @param res_id: on which document the message is pushed @param model: name of the document linked with the mail @return url """ base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context) if base_url: - base_url += '/?id=%s&model=%s'%(res_id,model) + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + base_url += '/web/webclient/login?db=%s&login=%s&key=%s#id=%s&model=%s' % (cr.dbname, user.login, user.password, res_id, model) return base_url def is_installed(self, cr, uid): -- cgit v1.2.3 From 96774c2e0fdef3361e00c1e78a4723e28cd71ee9 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Wed, 21 Dec 2011 14:33:23 +0530 Subject: [FIX]Plugin:change res_id into list bzr revid: sgo@tinyerp.com-20111221090323-y3hp3jj1u3i599uo --- addons/plugin/plugin_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 8a9f2073c2d..1fccae814b2 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -54,7 +54,7 @@ class plugin_handler(osv.osv_memory): res_id = msg.res_id model = msg.model url = self._make_url(cr, uid, res_id, model) - name = self.pool.get(model).name_get(cr, uid, res_id)[0][1] + name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1] return (model,res_id, url,name) -- cgit v1.2.3 From 191d91c2f8b9c95715ba7363e9af2388fb5bf1f3 Mon Sep 17 00:00:00 2001 From: "tfr@openerp.com" <> Date: Mon, 26 Dec 2011 18:12:29 +0100 Subject: [FIX] center windows + push on partner bzr revid: tfr@openerp.com-20111226171229-g3szzsrs6zd0vg95 --- addons/plugin/plugin_handler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 0473fed55c6..ef990170e64 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -93,8 +93,7 @@ class plugin_handler(osv.osv_memory): msg = mail_message.parse_message(email) message_id = msg.get('message-id') mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) - if model=='res.partner': - model_obj = self.pool.get('mail.thread') + if message_id and mail_ids : mail_record = mail_message.browse(cr, uid, mail_ids)[0] res_id = mail_record.res_id @@ -106,8 +105,12 @@ class plugin_handler(osv.osv_memory): res_id = model_obj.message_new(cr, uid, msg) notify = "Mail succefully pushed, a new %s has been created " % model else: - model_obj.message_append_dict(cr, uid, [res_id], msg) + if model == 'res.partner': + model_obj = self.pool.get('mail.thread') + res = self.pool.get(model).browse(cr, uid, [res_id]) + model_obj.message_append_dict(cr, uid, res, msg) notify = "Mail succefully pushed" + url = self._make_url(cr, uid, res_id, model) return (model, res_id, url, notify) -- cgit v1.2.3