diff --git a/account_financial_report/report/abstract_report_xlsx.py b/account_financial_report/report/abstract_report_xlsx.py index fedecb9c..4c0cbe70 100644 --- a/account_financial_report/report/abstract_report_xlsx.py +++ b/account_financial_report/report/abstract_report_xlsx.py @@ -531,7 +531,10 @@ class AbstractReportXslx(models.AbstractModel): format_amt = report_data["formats"]["format_amount"] field_prefix = "format_amount" if "currency_id" in line_object and line_object.get("currency_id", False): - currency = line_object["currency_id"] + if isinstance(line_object["currency_id"], int): + currency = self.env["res.currency"].browse(line_object["currency_id"]) + else: + currency = line_object["currency_id"] field_name = "{}_{}".format(field_prefix, currency.name) if hasattr(self, field_name): format_amt = getattr(self, field_name) diff --git a/account_financial_report/report/general_ledger_xlsx.py b/account_financial_report/report/general_ledger_xlsx.py index f3f73972..e16b806d 100644 --- a/account_financial_report/report/general_ledger_xlsx.py +++ b/account_financial_report/report/general_ledger_xlsx.py @@ -237,6 +237,15 @@ class GeneralLedgerXslx(models.AbstractModel): # Display array header for move lines self.write_array_header(report_data) + account.update( + { + "currency_id": accounts_data[account["id"]]["currency_id"], + "currency_name": accounts_data[account["id"]][ + "currency_name" + ], + } + ) + # Display initial balance line for partner group_item.update( { @@ -248,6 +257,9 @@ class GeneralLedgerXslx(models.AbstractModel): if "grouped_by" in account else "", "currency_id": accounts_data[account["id"]]["currency_id"], + "currency_name": accounts_data[account["id"]][ + "currency_name" + ], } ) if foreign_currency: @@ -315,8 +327,6 @@ class GeneralLedgerXslx(models.AbstractModel): group_item.update( { "final_bal_curr": group_item["fin_bal"]["bal_curr"], - "currency_name": group_item["currency_id"].name, - "currency_id": group_item["currency_id"].id, } ) self.write_ending_balance_from_dict(group_item, report_data) @@ -336,8 +346,6 @@ class GeneralLedgerXslx(models.AbstractModel): account.update( { "final_bal_curr": account["fin_bal"]["bal_curr"], - "currency_name": account["currency_id"].name, - "currency_id": account["currency_id"].id, } ) self.write_ending_balance_from_dict(account, report_data) diff --git a/account_financial_report/report/templates/general_ledger.xml b/account_financial_report/report/templates/general_ledger.xml index 7aa6a2ea..22feb9a7 100644 --- a/account_financial_report/report/templates/general_ledger.xml +++ b/account_financial_report/report/templates/general_ledger.xml @@ -307,6 +307,10 @@ +
@@ -326,7 +330,7 @@ > @@ -339,7 +343,7 @@ > @@ -350,7 +354,7 @@ > @@ -699,6 +703,10 @@ +
@@ -710,7 +718,7 @@ > @@ -725,7 +733,7 @@ > @@ -742,7 +750,7 @@ > @@ -757,7 +765,7 @@ >