From 62035e967e613c944a6dcff851225811b3ed7b57 Mon Sep 17 00:00:00 2001 From: "Ravi Gohil (OpenERP)" Date: Wed, 3 Jul 2013 16:40:59 +0530 Subject: [FIX] plugin: Email pushed using Outlook plugin does not have body content. (Maintenance Case: 593592) bzr revid: rgo@tinyerp.com-20130703111059-rphs9m0twt5w1me2 --- addons/plugin/plugin_handler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'addons/plugin/plugin_handler.py') diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index aa389611a57..b1cd4970cf7 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -4,6 +4,7 @@ Created on 18 oct. 2011 @author: openerp ''' +from openerp import tools from openerp.osv import osv from openerp.tools.translate import _ @@ -94,7 +95,7 @@ class plugin_handler(osv.osv_memory): mail_message = self.pool.get('mail.message') model_obj = self.pool.get(model) msg = self.pool.get('mail.thread').message_parse(cr, uid, email) - message_id = msg.get('message-id') + message_id = msg.get('message_id') mail_ids = mail_message.search(cr, uid, [('message_id', '=', message_id), ('res_id', '=', res_id), ('model', '=', model)]) if message_id and mail_ids: mail_record = mail_message.browse(cr, uid, mail_ids)[0] @@ -112,7 +113,8 @@ class plugin_handler(osv.osv_memory): subject=msg.get('subject'), type='comment' if model == 'res.partner' else 'email', parent_id=msg.get('parent_id'), - attachments=msg.get('attachments')) + attachments=msg.get('attachments'), + message_id=message_id) notify = _("Mail successfully pushed") url = self._make_url(cr, uid, res_id, model) return (model, res_id, url, notify) @@ -151,7 +153,7 @@ class plugin_handler(osv.osv_memory): ir_attachment_obj = self.pool.get('ir.attachment') attach_ids = [] msg = self.pool.get('mail.thread').message_parse(cr, uid, headers) - message_id = msg.get('message-id') + message_id = msg.get('message_id') push_mail = self.push_message(cr, uid, model, headers, res_id) res_id = push_mail[1] model = push_mail[0] @@ -165,6 +167,6 @@ class plugin_handler(osv.osv_memory): attach_ids.append(ir_attachment_obj.create(cr, uid, vals)) mail_ids = mail_message.search(cr, uid, [('message_id', '=', message_id), ('res_id', '=', res_id), ('model', '=', model)]) if mail_ids: - mail_message.write(cr, uid, mail_ids[0], {'attachment_ids': [(6, 0, attach_ids)], 'body': body, 'body_html': body_html}) + mail_message.write(cr, uid, mail_ids[0], {'attachment_ids': [(6, 0, attach_ids)], 'body': tools.plaintext2html(body), 'body_html': body_html}) url = self._make_url(cr, uid, res_id, model) return (model, res_id, url, notify) -- cgit v1.2.3