ERPNext v15 data import child table "Accounts table cannot be blank."

Hi, I have problem in data import feature in ERPNext v15.

For the current issue is during importing journal entry, after trying to use data import template, and table structure from data export from Journal Entry list.
The error message occurred is:

Message
Accounts table cannot be blank.
Traceback (most recent call last):
  File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 149, in import_data
    doc = self.process_doc(doc)
          ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 251, in process_doc
    return self.insert_record(doc)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 270, in insert_record
    new_doc.insert()
  File "apps/frappe/frappe/model/document.py", line 291, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1091, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 146, in validate
    self.validate_empty_accounts_table()
  File "apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 1194, in validate_empty_accounts_table
    frappe.throw(_("Accounts table cannot be blank."))
  File "apps/frappe/frappe/__init__.py", line 645, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 610, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 561, in _raise_exception
    raise exc
frappe.exceptions.ValidationError: Accounts table cannot be blank.

I suspect it is because of accounts child table is not specified, so I tried to specify accounts child table by adding random string for accounts ID field like below, but not success.

Can someone direct me to import journal entry?

Hi @WeiCho,

When importing data, please refrain from mentioning the ID if the data is new. Additionally, if there’s a field named “name” in the child table, avoid adding a random string to it. Simply put, left the “name” and “ID” columns, then proceed with the import.

Hi @NCP,
Thank you for your reply! The same issue and traceback log happens when child table name field is empty, or the header is removed from source.

Worked properly in v15. please check it.

I think it is a fluke on the data import transaction, I have tried 2 documents of data import: journal entry and purchase invoice.
Both have the same issue, but after repairing the csv file it still fail to import with the same error.
I make new data import transaction with the same csv file and it worked properly. Both for the purchase invoice and journal entry.

The old transaction still shows error, though. But it does not matter since the data is already in the ERP.