[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
This commit is contained in:
Thibault Delavallée 2013-11-26 12:07:42 +01:00
parent 41ca7536e0
commit 6f322004cc
1 changed files with 3 additions and 2 deletions

View File

@ -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