CoA importer error TypeError: 'str' object is not callable

I get this message when trying to import CoA

TypeError: ‘str’ object is not callable

"erpnext": "12.6.0",
"erpnext_support": "0.0.3",
"frappe": "12.4.1",
"journeys": "0.0.1"

}
Route
Form/Chart of Accounts Importer
Error Report
Traceback (most recent call last):
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.api.handle()
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/init.py”, line 1054, in call
return fn(*args, **newargs)
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py”, line 63, in get_coa
forest = build_forest(generate_data_from_csv(file_name))
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py”, line 121, in build_forest
path = return_parent(data, account_name)[::-1]
File “/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py”, line 101, in return_parent
frappe.throw(_(“The parent account {0} does not exists”)
TypeError: ‘str’ object is not callable
Request Data
{
“type”: “POST”,
“args”: {
“file_name”: “/files/coa.csv”,
“parent”: “All Accounts”,
“doctype”: “Chart of Accounts Importer”,
“is_root”: true
},
“headers”: {},
“error_handlers”: {},
“url”: “/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa”
}
Response JSON
{}

1 Like

I just got this solved!!!
First, ensure that the Parent Account exactly matches the corresponding Account Name. Use Excel’s vlookup to ensure there’s a perfect match for ALL records.
Secondly, don’t put the account number which is also the first rule. I made the previous error of putting the account number because in the OTHER Data Import tool used before Version 12, you need to put the account number and the company code.
SOLVED!

1 Like

One more important rule: Account name should be unique, whether it’s a group account or not.

Can I share my chart of accounts importer csv with you for a second opinion? I have followed all your instructions.

Please do.

Hi Danishaak,
No problem. You can email to me.

Thank you so much for graciously accepting. I had to meticulously dig into the csv and you were right, the names need to be unique, and need to match the parent account exactly. lowercase, uppercase, everything.

That being said, your solution +1. It works like a charm.

You’re welcome. Nice to hear everything’s going well now.