[FIX] mail: do no pop reply_to if same thread or post in the document is false
authorDenis Ledoux <dle@openerp.com>
Mon, 10 Feb 2014 09:23:01 +0000 (10:23 +0100)
committerDenis Ledoux <dle@openerp.com>
Mon, 10 Feb 2014 09:23:01 +0000 (10:23 +0100)
Otherwiwse if same thread is checked and post not, the reply_to is forced to the user email to avoid the email to be regarded as private without having a parent mail (has the parent is not posted in the thread), which is not what is expected

bzr revid: dle@openerp.com-20140210092301-1bdyvdwgekwgo9rh

addons/mail/wizard/mail_compose_message.py

index 0ef8e3c..2d09a92 100644 (file)
@@ -323,10 +323,10 @@ class mail_compose_message(osv.TransientModel):
                 if email_dict.get('email_from'):
                     mail_values['email_from'] = email_dict.pop('email_from')
                 # replies redirection: mass mailing only
-                if not wizard.same_thread:
-                    mail_values['reply_to'] = email_dict.pop('reply_to', None)
-                else:
+                if wizard.same_thread and wizard.post:
                     email_dict.pop('reply_to', None)
+                else:
+                    mail_values['reply_to'] = email_dict.pop('reply_to', None)
                 mail_values.update(email_dict)
             # mass mailing without post: mail_mail values
             if mass_mail_mode and not wizard.post: