From cf0a878e69f130b56360fef5d8b251186d7d0d30 Mon Sep 17 00:00:00 2001 From: Jinjiu Liu Date: Tue, 3 Jan 2023 10:47:36 +0000 Subject: [PATCH] [FIX] l10n_gcc_invoice: language context lost in template rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reproduction: 1. Install Accounting, l10n_sa 2. Create/Switch to a company located in Saudi Arabia 3. Go to Accounting -> Customer Invoice, and create a new invoice with a customer with language preference set to Arabic 4. Choose any product, and set the Payment terms as Immediate Payment 5. Confirm the invoice and print it, the payment term on the left end of the invoice is in Arabic, which should be in English Reason: in Odoo 16, the rendering of “t-field” loses the provided context because the values are rendered with the env context instead. The change is introduced by https://github.com/odoo/odoo/commit/880954ebfc1106411b7f7a7d60aee05dfae60893 here: https://github.com/odoo/odoo/blob/810a1d29bfa7c497627a37e0cec64df51b75bb4b/odoo/addons/base/models/ir_qweb_fields.py#L120 Fix: Using “t-out” instead of “t-field” for html fields in the template to keep the forced context of en-US. Similar fixes are done for other html fields in this template, e.g. fiscal_position_id.note, narration. These fields’ types were changed from Char to Html here: https://github.com/odoo-dev/odoo/commit/23483865b1508346f5a5e178f4a436fe1a9d9f55 Related commit: Change in ir_qweb_fields.py : https://github.com/odoo/odoo/commit/880954ebfc1106411b7f7a7d60aee05dfae60893 Change of field type: https://github.com/odoo-dev/odoo/commit/23483865b1508346f5a5e178f4a436fe1a9d9f55 opw-3085284 closes odoo/odoo#109083 X-original-commit: 3351aa4b36b3d2e6f42ec9acd1b11121d0cfedc0 Signed-off-by: Liu Jinjiu (jili) --- addons/l10n_gcc_invoice/views/report_invoice.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/l10n_gcc_invoice/views/report_invoice.xml b/addons/l10n_gcc_invoice/views/report_invoice.xml index 5bfcb98e9bd..5f6900e22fb 100644 --- a/addons/l10n_gcc_invoice/views/report_invoice.xml +++ b/addons/l10n_gcc_invoice/views/report_invoice.xml @@ -449,10 +449,10 @@

- +
- +
@@ -460,20 +460,20 @@

- +
- +

- +
- +