Hello,
When i fill item_code thought custom script I’m unable to get rate and amount automatically.
frappe.ui.form.on("Sales Order Item",{
item_code : function (frm, cdt, cdn){
var d2 = locals[cdt][cdn];
frappe.call({
"method": "custom_bom.api.saveBOM",
args: {
item :d2.item_code,
currency :'INR',
items : material_popup.get_values().material
},
freeze: true,
freeze_message: __("Loading"),
callback: function (r, rt) {
d2.item_code= r.item_code
d2.qty= r.qty
frm.refresh_field("items")
material_popup.hide();
}
})
}
})