Merge pull request #33311 from frappe/mergify/bp/version-14-hotfix/pr-33303

fix: incorrect balance on parent company on consolidate Balance sheet due to key mismatch (backport #33303)
This commit is contained in:
ruthra kumar
2022-12-13 13:45:41 +05:30
committed by GitHub

View File

@@ -533,12 +533,13 @@ def get_accounts(root_type, companies):
],
filters={"company": company, "root_type": root_type},
):
if account.account_name not in added_accounts:
if account.account_number:
account_key = account.account_number + "-" + account.account_name
else:
account_key = account.account_name
if account_key not in added_accounts:
accounts.append(account)
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