How to insert the values in child doctype

def make_quality(source_name, target_doc=None):
	doc = get_mapped_doc("Quality Inspection", source_name, {
		"Quality Inspection": {
			"doctype": "Stock Entry",
			"validation": {
				"docstatus": ["=", 1]
		"Quality Inspection Item": {
			"doctype": "Stock Entry Detail",
			"field_map": {
				"stock_qty": "transfer_qty",
				"batch_no": "batch_no"
	}, target_doc)
	for d in doc.get("items"):
		if d.ins_status == "Accepted":
			row = doc.append("items", {
				"item_code": d.item_code,
				"qty": str(d.qty),
	return row

This is my code… I want to store one child doctype values into another. The values are fetched successfully but didn’t insert.


You need to save the doc record too, after the append: