From 9d2dba4ea7856bbe39cbeacfe63bd284474f2e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 5 Mar 2013 16:13:32 +0100 Subject: [PATCH] [IMP] mail_thread: handle use_email_to when managing incoming emails. bzr revid: tde@openerp.com-20130305151332-q6bcr91gk51ugk9v --- addons/mail/mail_thread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index ac4a1b8ae9c..2a5d2e2a4fd 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -468,6 +468,8 @@ class mail_thread(osv.AbstractModel): # 1. Verify if this is a reply to an existing thread thread_references = references or in_reply_to ref_match = thread_references and tools.reference_re.search(thread_references) + use_email_to = thread_references and tools.use_email_to_re.search(thread_references) + if ref_match: thread_id = int(ref_match.group(1)) model = ref_match.group(2) or model @@ -479,7 +481,7 @@ class mail_thread(osv.AbstractModel): return [(model, thread_id, custom_values, uid)] # Verify whether this is a reply to a private message - if in_reply_to: + if in_reply_to and not use_email_to: message_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', '=', in_reply_to)], limit=1, context=context) if message_ids: message = self.pool.get('mail.message').browse(cr, uid, message_ids[0], context=context)