From c023e1d562b945287fcb7b3256f9a55c95e9ee1b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Aug 2017 12:27:47 +0200 Subject: [FIX] mail: add custom headers for mails send via the composer --- addons/mail/wizard/mail_compose_message.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/mail/wizard/mail_compose_message.py') diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index f55854a704e..5afdaa3ab2a 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -294,6 +294,9 @@ class MailComposer(models.TransientModel): 'no_auto_thread': self.no_auto_thread, 'mail_server_id': self.mail_server_id.id, } + if self.model in self.env and hasattr(self.env[self.model], 'message_get_email_values'): + mail_values.update(self.env[self.model].browse(res_id).message_get_email_values()) + # mass mailing: rendering override wizard static values if mass_mail_mode and self.model: # keep a copy unless specifically requested, reset record name (avoid browsing records) -- cgit v1.2.3 From 902fc764d502d411096a0d49eed6faa07120905d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Aug 2017 13:32:34 +0200 Subject: [FIX] mail: only set `header` value for emails (not comments) --- addons/mail/wizard/mail_compose_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/mail/wizard/mail_compose_message.py') diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 5afdaa3ab2a..957a8fa86b6 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -294,11 +294,11 @@ class MailComposer(models.TransientModel): 'no_auto_thread': self.no_auto_thread, 'mail_server_id': self.mail_server_id.id, } - if self.model in self.env and hasattr(self.env[self.model], 'message_get_email_values'): - mail_values.update(self.env[self.model].browse(res_id).message_get_email_values()) # mass mailing: rendering override wizard static values if mass_mail_mode and self.model: + if self.model in self.env and hasattr(self.env[self.model], 'message_get_email_values'): + mail_values.update(self.env[self.model].browse(res_id).message_get_email_values()) # keep a copy unless specifically requested, reset record name (avoid browsing records) mail_values.update(notification=not self.auto_delete_message, model=self.model, res_id=res_id, record_name=False) # auto deletion of mail_mail -- cgit v1.2.3