Specifically, I want to get uom details in the item selection in sales invoice. I have the following code with bug. The error message I am getting is “Field not permitted in query: UOMs” with in the frappe.call.
frappe.ui.form.on(‘Sales Invoice Item’,{
item_code(frm, cdt, cdn){
let row= frappe.get_doc(cdt,cdn);
console.log(row);
console.log(cdt);
console.log(cdn);
let doc = frappe.model.get_value("Item", row.item_name);
console.log(doc);
let value;
frappe.call({
method: 'frappe.client.get_value',
args: {
'doctype': 'Item',
'filters': { 'item_code': row.item_code },
'fieldname': 'UOMs'
},
async: false,
callback: function (r) {
if (!r.exc) {
console.log(r.message);
}
}
});
}
}
);