From 9063f74cee94deede698a671ca0b3837064393b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 25 Jul 2023 08:55:42 +0200 Subject: [PATCH] [FIX] account_financial_report: Prevent error related to currency from Trial Balance Use case: Generate report (showing foreign currency) with accounts with defined currency. Traceback: Error to render compiling AST AttributeError: 'int' object has no attribute 'decimal_places' Template: account_financial_report.report_trial_balance_line Path: /t/div/t[3]/t[1]/t/t/div/span/t Node: The error occured while rendering the template account_financial_report.report_trial_balance_line and evaluating the following expression: --- .../report/templates/trial_balance.xml | 20 +++++++++++++++---- .../report/trial_balance.py | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/account_financial_report/report/templates/trial_balance.xml b/account_financial_report/report/templates/trial_balance.xml index 90f222e7..934c1e6f 100644 --- a/account_financial_report/report/templates/trial_balance.xml +++ b/account_financial_report/report/templates/trial_balance.xml @@ -559,6 +559,10 @@ +
@@ -602,9 +606,13 @@ t-att-domain="domain+aml_domain_common" res-model="account.move.line" > +
@@ -626,7 +634,7 @@ > @@ -657,9 +665,13 @@ t-att-domain="domain+aml_domain_common" res-model="account.move.line" > + diff --git a/account_financial_report/report/trial_balance.py b/account_financial_report/report/trial_balance.py index 1d2f51b2..f0c57dd5 100644 --- a/account_financial_report/report/trial_balance.py +++ b/account_financial_report/report/trial_balance.py @@ -755,4 +755,5 @@ class TrialBalanceReport(models.AbstractModel): "accounts_data": accounts_data, "partners_data": partners_data, "show_hierarchy_level": show_hierarchy_level, + "currency_model": self.env["res.currency"], }