fix: not able to import chart of account if parent account is missing (#20368)
This commit is contained in:
parent
eea0ffcb38
commit
5056c8bcb4
@ -96,7 +96,11 @@ def build_forest(data):
|
||||
if parent_account == account_name == child:
|
||||
return [parent_account]
|
||||
elif account_name == child:
|
||||
return [child] + return_parent(data, parent_account)
|
||||
parent_account_list = return_parent(data, parent_account)
|
||||
if not parent_account_list:
|
||||
frappe.throw(_("The parent account {0} does not exists")
|
||||
.format(parent_account))
|
||||
return [child] + parent_account_list
|
||||
|
||||
charts_map, paths = {}, []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user