fix: key error on consolidated financial report

accounts with same name but different account number will throw key
error on consolidated report

(cherry picked from commit 6e8395cccd)
This commit is contained in:
ruthra kumar
2022-09-02 09:50:42 +05:30
committed by Mergify
parent 0a3ac82232
commit 20919c8626

View File

@@ -535,7 +535,11 @@ def get_accounts(root_type, companies):
): ):
if account.account_name not in added_accounts: if account.account_name not in added_accounts:
accounts.append(account) 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 return accounts