From 21a6ba351922bd25a75a7e48e8448984d8c87458 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 13 Sep 2012 13:55:35 +0530 Subject: [FIX] plugin: first search message_id than search parent message if not found bzr revid: hmo@tinyerp.com-20120913082535-syibk95l0kmz60nw --- addons/plugin/plugin_handler.py | 7 +++++-- 1 file changed, 5 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 983f3d60dfc..42754951317 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -45,11 +45,14 @@ class plugin_handler(osv.osv_memory): url = "" name = "" msg = self.pool.get('mail.thread').message_parse(cr, uid, email) - msg_id = msg.get('parent_id', False) + parent_id = msg.get('parent_id', False) message_id = msg.get('message_id') - if not msg_id: + msg_id = False + if message_id: msg_ids = mail_message_obj.search(cr, uid, [('message_id','=', message_id)]) msg_id = len(msg_ids) and msg_ids[0] or False + if not msg_id and parent_id: + msg_id = parent_id if msg_id: msg = mail_message_obj.browse(cr, uid, msg_id) res_id = msg.res_id -- cgit v1.2.3