diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-09-28 13:17:37 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-09-28 13:17:37 +0200 |
| commit | 12548d3e73363a1bc6ae63f1cc1e69a38b9f6ba4 (patch) | |
| tree | 9fbc0f90967854873b9f9fc3377932d0ef25a9cf /addons/mail/wizard/mail_compose_message.py | |
| parent | a04522ac57944d5f49af8cda5dd480bc3e73e504 (diff) | |
| parent | e8b8784d5cafbba11557e1aa46c3a9ee93baa3c2 (diff) | |
[MERGE] forward port branch saas-10 up to e8b8784
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 907bda2e0db..176ea88aec1 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -192,7 +192,7 @@ class MailComposer(models.TransientModel): @api.multi def send_mail_action(self): # TDE/ ??? - return self.with_context(report_template_in_attachment=True).send_mail() + return self.send_mail() @api.multi def send_mail(self, auto_commit=False): @@ -358,20 +358,6 @@ class MailComposer(models.TransientModel): if template.user_signature and 'body_html' in values: signature = self.env.user.signature values['body_html'] = tools.append_content_to_html(values['body_html'], signature, plaintext=False) - if template.report_template: - attachment = self.env['ir.attachment'] - attach = self.generate_attachment_from_report(template_id, res_id) - for attach_fname, attach_datas in attach[res_id].pop('attachments', []): - data_attach = { - 'name': attach_fname, - 'datas': attach_datas, - 'datas_fname': attach_fname, - 'res_model': 'mail.compose.message', - 'res_id': 0, - 'type': 'binary', - } - values.setdefault('attachment_ids', list()).append(attachment.create(data_attach).id) - elif template_id: values = self.generate_email_for_composer(template_id, [res_id])[res_id] # transform attachments into attachment_ids; not attached to the document because this will @@ -403,13 +389,6 @@ class MailComposer(models.TransientModel): return {'value': values} @api.multi - def generate_attachment_from_report(self, template_id, res_id): - fields = ['attachment_ids'] - result = self.env['mail.template'].with_context(tpl_partners_only=True).browse(template_id).generate_email([res_id], fields=fields) - return result - - - @api.multi def save_as_template(self): """ hit save as template button: current form value will be a new template attached to the current document. """ |
