How to fetch value from current doctype to current doctype child tabel

Hii
i have required my current doctype is sales order current doctype field is test this field is required in sales order item child tabel in also test field so how i can get this pls help

Hi harshal,
First you have to customize sales order as you can’t make changes in the core directly.
After customizing you have to write a script on sales_order.py on validate event file.
E.g.

def validate(self):
for row in self.items:
row.test = self.test

If you don’t want to set value for all rows,
write a script on .js file
frappe.model.set_value(cdt,cdn,'test',frm.test)