From a035428d43e0bce3a8dce8a8ccaaf5ed6867c52f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 10 Sep 2019 14:50:55 +0530 Subject: [PATCH] fix: handling of key does not exists error --- .../chart_of_accounts_importer/chart_of_accounts_importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py index 4683c7ae46..9bf5887b38 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py @@ -150,7 +150,7 @@ def validate_accounts(file_name): accounts_dict = {} for account in accounts: accounts_dict.setdefault(account["account_name"], account) - if account["parent_account"] and accounts_dict[account["parent_account"]]: + if account["parent_account"] and accounts_dict.get(account["parent_account"]): accounts_dict[account["parent_account"]]["is_group"] = 1 message = validate_root(accounts_dict)