fix: chart of accounts importer always error (#25882)

* fix: chart of accounts importer always error 

chart of accounts importer always error Parent Account Missing

* Update chart_of_accounts_importer.py
This commit is contained in:
Fisher Yu 2021-06-01 14:45:58 +08:00 committed by GitHub
parent 2c7fac0e76
commit 865663857c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,7 +293,7 @@ def validate_accounts(file_name):
accounts_dict = {}
for account in accounts:
accounts_dict.setdefault(account["account_name"], account)
if not hasattr(account, "parent_account"):
if "parent_account" not in account:
msg = _("Please make sure the file you are using has 'Parent Account' column present in the header.")
msg += "<br><br>"
msg += _("Alternatively, you can download the template and fill your data in.")