From 7124d7012d03e8bb7e4b701d0a95331e3d1d41f2 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 18 Feb 2021 10:51:32 +0000 Subject: [PATCH] [FIX] mail: translate report name field When genrating an attachment in a mail message (e.g. the pdf attached to a confirmation email), the filename was not translated into the language of the recipient (unlink the email content). The variable `template` has the contact language in the context while `self` contains the language of the user executing the action. Fixes odoo/odoo#66420 closes odoo/odoo#66498 X-original-commit: 6001e7584c28f8d028c782692caa644015c33e9c Signed-off-by: Martin Trigaux (mat) --- addons/mail/models/mail_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index 68078157dc7..af9e3b57469 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -191,7 +191,7 @@ class MailTemplate(models.Model): if template.report_template: for res_id in template_res_ids: attachments = [] - report_name = self._render_field('report_name', [res_id])[res_id] + report_name = template._render_field('report_name', [res_id])[res_id] report = template.report_template report_service = report.report_name