diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-10-01 17:26:32 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-10-02 12:35:34 +0200 |
| commit | 532d82a7a9952c5ee843f91e63aae1ca986c6c9d (patch) | |
| tree | 687d28b385891b1ea6bd37e71267f2bb26a5597e /addons/mail/wizard/mail_compose_message.py | |
| parent | b2b9545cf38855fdb97e992aa2883cdab6909e96 (diff) | |
[IMP] mail: Make mail.compose.message code more readable
Purpose
=======
Remove the method 'render_template' in mail.compose.message as the indirection
is not useful. Call the method on the correct model (mail.template) directly.
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index bf794fc2a7f..bac7148ca9c 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -458,10 +458,10 @@ class MailComposer(models.TransientModel): multi_mode = False res_ids = [res_ids] - subjects = self.render_template(self.subject, self.model, res_ids) - bodies = self.render_template(self.body, self.model, res_ids, post_process=True) - emails_from = self.render_template(self.email_from, self.model, res_ids) - replies_to = self.render_template(self.reply_to, self.model, res_ids) + subjects = self.env['mail.template']._render_template(self.subject, self.model, res_ids) + bodies = self.env['mail.template']._render_template(self.body, self.model, res_ids, post_process=True) + emails_from = self.env['mail.template']._render_template(self.email_from, self.model, res_ids) + replies_to = self.env['mail.template']._render_template(self.reply_to, self.model, res_ids) default_recipients = {} if not self.partner_ids: default_recipients = self.env['mail.thread'].message_get_default_recipients(res_model=self.model, res_ids=res_ids) @@ -520,7 +520,3 @@ class MailComposer(models.TransientModel): values[res_id] = res_id_values return multi_mode and values or values[res_ids[0]] - - @api.model - def render_template(self, template, model, res_ids, post_process=False): - return self.env['mail.template'].render_template(template, model, res_ids, post_process=post_process) |
