changeset ba1b3bfda9bb in modules/account_invoice:default
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=ba1b3bfda9bb
description:
        Clear invoice report language only for rendering

        Otherwise the report name is rendered always in english

        issue8881
        review260621002
diffstat:

 invoice.py |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 32b85372e823 -r ba1b3bfda9bb invoice.py
--- a/invoice.py        Sat Dec 14 10:47:54 2019 +0100
+++ b/invoice.py        Wed Dec 18 09:21:49 2019 +0100
@@ -2509,12 +2509,17 @@
             return result
 
     @classmethod
+    def render(cls, *args, **kwargs):
+        # Reset to default language to always have header and footer rendered
+        # in the default language
+        with Transaction().set_context(language=False):
+            return super().render(*args, **kwargs)
+
+    @classmethod
     def execute(cls, ids, data):
         pool = Pool()
         Invoice = pool.get('account.invoice')
-        with Transaction().set_context(
-                language=False,
-                address_with_party=True):
+        with Transaction().set_context(address_with_party=True):
             result = super(InvoiceReport, cls).execute(ids, data)
             if len(ids) == 1:
                 invoice, = Invoice.browse(ids)

Reply via email to