Fetch rows from child table to another child table

Hello

I have created some custom doctypes for a property management module, and was trying to mimic the feature of Stock Quality Inspection template to create Property inspection template.

First I tried with Py an Js files from the Quality inspection code Link but without success.

Second I tried with custom scripts and after searching the forum for help I found this

my code is as follows:

DocTypeA = Property Inspection Template
DocTypeB = Property Inspection
ChildTableA= Property Inspection Parameter / property_inspection_parameter
ChildTableB= Property Inspection Reading / readings
Trigger = property_inspection_template
field1,2 = specification / value
fielda,b = specification / value


frappe.ui.form.on("Property Inspection", "property_inspection_template", function(frm) {
frappe.model.with_doc("Property Inspection Template", frm.doc.property_inspection_template, function() {
var tabletransfer= frappe.model.get_doc("Property Inspection Template", frm.doc.property_inspection_template)
$.each(qmtable.property_inspection_parameter, function(index, row){
d = frm.add_child("readings");
d.specification = row.specification;
d.value = row.value;
cur_frm.refresh_field("readings");
})
});
});

Any help is appreciated
Thanks to you all