From a1a66985584a5d8db49d5bdd2c5b7199ee0a0b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 7 Jun 2013 11:16:11 +0200 Subject: [PATCH] [CLEAN] mail: cleaned reply_to code, finally. bzr revid: tde@openerp.com-20130607091611-7cpzlxzngkrs86a0 --- addons/mail/mail_mail.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 62c1a9fff19..1398e00255b 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -88,18 +88,16 @@ class mail_mail(osv.Model): """ if values.get('reply_to'): return values.get('reply_to') - redirect_gateway = True # whether replies will be redirected inside the document - - # email_reply_to, model, res_id: comes from values OR related message + format_name = True # whether to use a 'Followers of Pigs reply_to will be the email_from, only the email part + # no alias reply_to -> reply_to will be the email_from if not email_reply_to and email_from: - emails = tools.email_split(email_from) - if emails: - email_reply_to = emails[0] + email_reply_to = email_from # format 'Document name ' - if email_reply_to and model and res_id and redirect_gateway: + if email_reply_to and model and res_id and format_name: + emails = tools.email_split(email_reply_to) + if emails: + email_reply_to = emails[0] document_name = self.pool[model].name_get(cr, SUPERUSER_ID, [res_id], context=context)[0] if document_name: # sanitize document name