fix(accounts): require account types in chart imports

(cherry picked from commit 9c9b82f7bb)
This commit is contained in:
pandiyan
2026-10-25 21:52:08 +00:00
committed by Mergify
parent d6a04da0d5
commit f2a342169b
@@ -394,6 +394,18 @@ def validate_accounts(file_doc, extension):
validate_root(accounts_dict)
account_types = {account.get("account_type") for account in accounts}
missing = [
_(account["account_type"])
for account in get_mandatory_account_types()
if account["account_type"] not in account_types
]
if missing:
frappe.throw(
_("Please add accounts for the following Account Types: {0}").format(", ".join(missing)),
title=_("Missing Account Types"),
)
return [True, len(accounts)]