ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Sales Order read only function not working

Hi all,
In v13 sales order read only code not working pls guide anyone
frappe.ui.form.on(‘Sales Order’, ‘refresh’, function(frm, cdt, cdn){
var df = frappe.meta.get_docfield(“Sales Order Item”,“item_code”, frm.doc.name);
df.read_only = 1;
})

Thanks