From 6f322004cc4c5ea886231fb18c17cc9310802f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 26 Nov 2013 12:07:42 +0100 Subject: [PATCH] [FIX] email_template: when generating reports in batch, update the values for all res_ids, not only the last one of the current template. bzr revid: tde@openerp.com-20131126110742-aecac7r0zyappo0a --- addons/email_template/email_template.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index efa1387435a..ab95613c283 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -369,7 +369,7 @@ class email_template(osv.osv): attachment_ids=[attach.id for attach in template.attachment_ids], ) - # Add report in attachments + # Add report in attachments: generate once for all template_res_ids if template.report_template: for res_id in template_res_ids: attachments = [] @@ -388,7 +388,8 @@ class email_template(osv.osv): report_name += ext attachments.append((report_name, result)) - values['attachments'] = attachments + for res_id in template_res_ids: + results[res_id]['attachments'] = attachments return results