[FIX] mass_mailing: on mass mailing sending, set same_thread for message composer
authorDenis Ledoux <dle@openerp.com>
Sun, 1 Jun 2014 20:08:56 +0000 (22:08 +0200)
committerDenis Ledoux <dle@openerp.com>
Sun, 1 Jun 2014 20:08:56 +0000 (22:08 +0200)
same_thread boolean field of mail.compose.message model define wether or not replies should be posted in the thread or not
On composer creation, this boolean should be passed according to the reply_to_mode of the mass_mailing
Otherwise, all replies would be posted in the thread, and the reply_to will be ignored (if same_thread id True, reply_to is poped from the mails values, mail/wizard/mail_compose_message.py:284)

addons/mail/wizard/mail_compose_message.py
addons/mass_mailing/models/mass_mailing.py

index cb068d5..d51118c 100644 (file)
@@ -244,6 +244,8 @@ class mail_compose_message(osv.TransientModel):
     def get_mail_values(self, cr, uid, wizard, res_ids, context=None):
         """Generate the values that will be used by send_mail to create mail_messages
         or mail_mails. """
+        import pudb
+        pudb.set_trace()
         results = dict.fromkeys(res_ids, False)
         rendered_values, default_recipients = {}, {}
         mass_mail_mode = wizard.composition_mode == 'mass_mail'
index 18c5ad5..bfeb3ae 100644 (file)
@@ -571,6 +571,7 @@ class MassMailing(osv.Model):
                 'composition_mode': 'mass_mail',
                 'mass_mailing_id': mailing.id,
                 'mailing_list_ids': [(4, l.id) for l in mailing.contact_list_ids],
+                'same_thread': mailing.reply_to_mode == 'thread',
             }
             if mailing.reply_to_mode == 'email':
                 composer_values['reply_to'] = mailing.reply_to