From 7646d7b741ecd24ea42909cc7e0c2e128a69d393 Mon Sep 17 00:00:00 2001 From: marination Date: Mon, 11 Jan 2021 10:27:05 +0530 Subject: [PATCH] fix: Batch/Serial Selector for Batched Item --- erpnext/stock/doctype/stock_entry/stock_entry.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); } }