From 6e8395cccdb9fc3eba0a0746450660e89155c9f5 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 2 Sep 2022 09:50:42 +0530 Subject: [PATCH] fix: key error on consolidated financial report accounts with same name but different account number will throw key error on consolidated report --- .../consolidated_financial_statement.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py index 98dbbf6c44..330e442a80 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py @@ -535,7 +535,11 @@ def get_accounts(root_type, companies): ): if account.account_name not in added_accounts: accounts.append(account) - added_accounts.append(account.account_name) + if account.account_number: + account_key = account.account_number + "-" + account.account_name + else: + account_key = account.account_name + added_accounts.append(account_key) return accounts