summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/models/mail_thread.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-19 16:21:12 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-19 16:21:12 +0200
commitb857fd4c905c39c187fff2e533e5ff6714a4aec0 (patch)
treea673c4a8136eb55e6dd55089c0ad3103af8c3d4a /addons/mass_mailing/models/mail_thread.py
parentc0bdf81a5be6a927135c480cdcbf8f9218033914 (diff)
parent11270336fa7dd225bf03fc664d80b1604d4cbc4b (diff)
[MERGE] forward port branch 10.0 up to 11270336fa7
Diffstat (limited to 'addons/mass_mailing/models/mail_thread.py')
-rw-r--r--addons/mass_mailing/models/mail_thread.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/mass_mailing/models/mail_thread.py b/addons/mass_mailing/models/mail_thread.py
index 8e515a664f8..ee5fb45f6eb 100644
--- a/addons/mass_mailing/models/mail_thread.py
+++ b/addons/mass_mailing/models/mail_thread.py
@@ -39,3 +39,13 @@ class MailThread(models.AbstractModel):
message_ids = [x.strip() for x in decode_smtp_header(message['References']).split()]
self.env['mail.mail.statistics'].set_replied(mail_message_ids=message_ids)
return super(MailThread, self).message_route_process(message, message_dict, routes)
+
+ @api.multi
+ def message_post_with_template(self, template_id, **kwargs):
+ # avoid having message send through `message_post*` methods being implicitly considered as
+ # mass-mailing
+ no_massmail = self.with_context(
+ default_mass_mailing_name=False,
+ default_mass_mailing_id=False,
+ )
+ return super(MailThread, no_massmail).message_post_with_template(template_id, **kwargs)