how to fetch data from child table using frappe.get_doc
review this
frappe.get_doc
will return the doc, only if it was already cached in the browser. You can use frappe.db.get_doc
to get from the DB directly. When you request the Parent Doc, you will also get all the child table values attached with it.
for example, if you call the frappe.get_doc('Sales Invoice','ACC-SINV-2021-00001')
function, it will also include the Child Table “Items” of “ACC-SINV-2021-00001” and its child table values in the Response.