[Solved] Insert and Submit documents with child tables in python script

Inserting child records first is not a good idea.

Instead you should try following:

record = frappe.get_doc(je_values_dict)
record.append("accounts", jeac_record)
record.append("accounts", jead_record)
record.insert()
record.submit()

while creating any entry, there is no need to specify following details:
name, creation, modified, modified_by, owner, docstatus, parent, parentfield and parenttype .
These fields are set automatically.

3 Likes