From 2d86eb3ab14bfc243fc158fef5c008f8f5095e1d Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 31 Mar 2021 19:57:50 +0530 Subject: [PATCH 1/2] fix: Hide serial and batch selector in Stock Entry --- erpnext/stock/doctype/stock_entry/stock_entry.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 64dcbed1d8..bdd572d3a5 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -100,6 +100,13 @@ frappe.ui.form.on('Stock Entry', { frm.add_fetch("bom_no", "inspection_required", "inspection_required"); erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype); + + frappe.db.get_single_value('Stock Settings', 'disable_serial_no_and_batch_selector') + .then((value) => { + if (value) { + frappe.flags.hide_serial_batch_dialog = true; + } + }); }, setup_quality_inspection: function(frm) { @@ -721,7 +728,8 @@ frappe.ui.form.on('Stock Entry Detail', { no_batch_serial_number_value = !d.batch_no; } - if (no_batch_serial_number_value) { + console.log(frappe.flags.hide_serial_batch_dialog, "$#$#$#"); + if (no_batch_serial_number_value && !frappe.flags.hide_serial_batch_dialog) { erpnext.stock.select_batch_and_serial_no(frm, d); } } From 9f7bb14ea1f1d527b57abf9d452b29eb09fe8783 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 31 Mar 2021 20:01:00 +0530 Subject: [PATCH 2/2] fix: Remove console --- erpnext/stock/doctype/stock_entry/stock_entry.js | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index bdd572d3a5..98246fb024 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -728,7 +728,6 @@ frappe.ui.form.on('Stock Entry Detail', { no_batch_serial_number_value = !d.batch_no; } - console.log(frappe.flags.hide_serial_batch_dialog, "$#$#$#"); if (no_batch_serial_number_value && !frappe.flags.hide_serial_batch_dialog) { erpnext.stock.select_batch_and_serial_no(frm, d); }