fix(Batch): reload doc after splitting

to show updated qty

(cherry picked from commit 34ec2f8a2b805e63c531ad293f3adb2061c219eb)
This commit is contained in:
barredterra 2024-01-23 14:57:23 +01:00 committed by Mergify
parent 6ed42e939b
commit a97b8fd876

View File

@ -128,19 +128,16 @@ frappe.ui.form.on('Batch', {
fieldtype: 'Data',
}],
(data) => {
frappe.call({
method: 'erpnext.stock.doctype.batch.batch.split_batch',
args: {
frappe.xcall(
'erpnext.stock.doctype.batch.batch.split_batch',
{
item_code: frm.doc.item,
batch_no: frm.doc.name,
qty: data.qty,
warehouse: $btn.attr('data-warehouse'),
new_batch_id: data.new_batch_id
},
callback: (r) => {
frm.refresh();
},
});
}
).then(() => frm.reload_doc());
},
__('Split Batch'),
__('Split')