diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 98116ec183..f75e8b727d 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -524,7 +524,7 @@ frappe.ui.form.on('Stock Entry', { }) ); } - + for (let i in frm.doc.items) { let item = frm.doc.items[i]; @@ -675,7 +675,13 @@ frappe.ui.form.on('Stock Entry Detail', { }); refresh_field("items"); - if (!d.serial_no) { + let no_batch_serial_number_value = !d.serial_no; + if (d.has_batch_no && !d.has_serial_no) { + // check only batch_no for batched item + no_batch_serial_number_value = !d.batch_no; + } + + if (no_batch_serial_number_value) { erpnext.stock.select_batch_and_serial_no(frm, d); } }