summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_template.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/models/mail_template.py')
-rw-r--r--addons/mail/models/mail_template.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py
index 3b8732d86ac..44cea49b102 100644
--- a/addons/mail/models/mail_template.py
+++ b/addons/mail/models/mail_template.py
@@ -476,9 +476,13 @@ class MailTemplate(models.Model):
report = template.report_template
report_service = report.report_name
- if report.report_type not in ['qweb-html', 'qweb-pdf']:
- raise UserError(_('Unsupported report type %s found.') % report.report_type)
- result, format = report.render_qweb_pdf([res_id])
+ if report.report_type in ['qweb-html', 'qweb-pdf']:
+ result, format = report.render_qweb_pdf([res_id])
+ else:
+ res = report.render([res_id])
+ if not res:
+ raise UserError(_('Unsupported report type %s found.') % report.report_type)
+ result, format = res
# TODO in trunk, change return format to binary to match message_post expected format
result = base64.b64encode(result)