[FIX] mass_mailing: on mass mailing sending, set same_thread for message composer

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)
This commit is contained in:
Denis Ledoux 2014-06-01 22:08:56 +02:00
parent d6a2ae642b
commit dd36a0e509
2 changed files with 3 additions and 0 deletions

View 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'

View 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