Skip to content
Snippets Groups Projects
Commit 367f7fba authored by Solan Delvenne (sode)'s avatar Solan Delvenne (sode)
Browse files

[FIX] snailmail: Force english locale on snail-mails


Pingen does not support localized country names, as such we need to force English
locale.

closes odoo/odoo#104852

Signed-off-by: default avatarFlorian Daloze (fda) <fda@odoo.com>
parent d7ea47f4
No related branches found
No related tags found
No related merge requests found
...@@ -129,7 +129,7 @@ class SnailmailLetter(models.Model): ...@@ -129,7 +129,7 @@ class SnailmailLetter(models.Model):
filename = "%s.%s" % (report_name, "pdf") filename = "%s.%s" % (report_name, "pdf")
if not self.cover: if not self.cover:
raise UserError(_("Snailmails without covers are no longer supported in Odoo 13.\nPlease enable the 'Add a Cover Page' option in your Invoicing settings or upgrade your Odoo.")) raise UserError(_("Snailmails without covers are no longer supported in Odoo 13.\nPlease enable the 'Add a Cover Page' option in your Invoicing settings or upgrade your Odoo."))
pdf_bin, unused_filetype = report.with_context(snailmail_layout=not self.cover).render_qweb_pdf(self.res_id) pdf_bin, unused_filetype = report.with_context(snailmail_layout=not self.cover, lang='en_US').render_qweb_pdf(self.res_id)
if self.cover: if self.cover:
pdf_bin = self._append_cover_page(pdf_bin) pdf_bin = self._append_cover_page(pdf_bin)
attachment = self.env['ir.attachment'].create({ attachment = self.env['ir.attachment'].create({
...@@ -410,7 +410,7 @@ class SnailmailLetter(models.Model): ...@@ -410,7 +410,7 @@ class SnailmailLetter(models.Model):
return failures_infos return failures_infos
def _append_cover_page(self, invoice_bin: bytes): def _append_cover_page(self, invoice_bin: bytes):
address = self.partner_id.with_context(show_address=True)._get_name().replace('\n', '<br/>') address = self.partner_id.with_context(show_address=True, lang='en_US')._get_name().replace('\n', '<br/>')
address_x = 118 * mm address_x = 118 * mm
address_y = 60 * mm address_y = 60 * mm
frame_width = 85.5 * mm frame_width = 85.5 * mm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment