summaryrefslogtreecommitdiff
path: root/addons/plugin/plugin_handler.py
diff options
context:
space:
mode:
authorHarry (OpenERP) <hmo@tinyerp.com>2012-09-13 13:55:35 +0530
committerHarry (OpenERP) <hmo@tinyerp.com>2012-09-13 13:55:35 +0530
commit21a6ba351922bd25a75a7e48e8448984d8c87458 (patch)
tree8f6711f36fe75c83633b314ff9ed8cb98956baad /addons/plugin/plugin_handler.py
parentfab90cb7d47f2173bb27616bf15094ad92118e2f (diff)
[FIX] plugin: first search message_id than search parent message if not found
bzr revid: hmo@tinyerp.com-20120913082535-syibk95l0kmz60nw
Diffstat (limited to 'addons/plugin/plugin_handler.py')
-rw-r--r--addons/plugin/plugin_handler.py7
1 files changed, 5 insertions, 2 deletions
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