Getting Customer from Sales Order in Production Order

Hi there,

i’m using a custom script:

frappe.ui.form.on("Production Order", {
  onload: function(frm) {
    console.log(frm.doc.sales_order);	
    let s = frappe.model.get_doc("Sales Order", frm.doc.sales_order);
    console.log("s:", s);
    frm.doc.customer_name = s.customer;
  }
});

What happen is that s is null, any hint?

Thx

did you solve your custom script?