Not able to create a new document with Child Table from Server Script

changed the code to
pr = frappe.get_doc(dict(“Purchase Receipt”)).insert() … instead of frappe.new_doc()
pr.update(
{
“supplier”: doc.supplier, “supplier_name”: doc.supplier_name, “posting_date”: doc.posting_date, “posting_time”: doc.posting_time

}

)

Error changed: