I am trying to get Batch Balance quantity for Sale Order Item (Similar to Sales Invoice Item). For that I have a custom field batch_number and batch_balance_qty.
I am using the below code:
frappe.ui.form.on(‘Sales Order Item’, ‘manufacturer_date’, function(frm,cdt,cdn) {
var item = frappe.get_doc(cdt,cdn);
frappe.call({
method: “erpnext.stock.get_item_details.get_batch_qty”,
args:{
batch_no: item.batch_number,
warehouse: item.warehouse,
item_code: item.item_code
},
callback: function(r){
item.batch_balance_qty = r;
}
})
});
And I am getting this error:
Traceback (most recent call last):
File “/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/handler.py”, line 40, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/init.py”, line 901, in call
return fn(*args, **newargs)
TypeError: get_batch_qty() takes exactly 3 arguments (2 given)
I have taken 3 arguments, batch_no, warehouse and item_code. Please help on why this error is coming.