I am trying to fetch the warehouse address and display when I key in stock entry, but unable to do so with my code below. Not sure what is wrong.
frappe.ui.form.on("Stock Entry", "validate", function(frm, cdt, cdn) {
var job = frappe.get_doc(cdt, cdn);
job.address_line_1 = cur_frm.add_fetch("warehouse", "address_line_1", "address_line_1");
refresh_field("address_line_1", job.name, job.parentfield);
})