From 60f528b5310f6f1ce65f93952ba64746c31515d4 Mon Sep 17 00:00:00 2001 From: khushi8112 Date: Wed, 29 Apr 2026 00:58:53 +0530 Subject: [PATCH] fix: minor UI and UX fixes --- erpnext/stock/doctype/item/item.js | 36 +++++++--------------------- erpnext/stock/doctype/item/item.json | 2 -- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index d857a02c313..362fa7a948b 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -913,12 +913,12 @@ $.extend(erpnext.item, { default: companies[0], reqd: 1, onchange: function () { - const wh = get_warehouse_for_company(dialog.get_value("company")); - dialog.set_value("warehouse", wh); + const warehouse = get_warehouse_for_company(dialog.get_value("company")); + dialog.set_value("warehouse", warehouse); dialog.set_df_property( "warehouse", "description", - wh + warehouse ? __("Default warehouse from Item Defaults.") : __( "No default warehouse set for this company. Entry will use Stock Settings default." @@ -960,7 +960,7 @@ $.extend(erpnext.item, { default: frm.doc.serial_no_series || "", reqd: 1, description: __( - "Example: SN-.YYYY.-.##### - One serial number will be created per unit of qty." + "Example: SN-.YYYY.-.#####. - One serial number will be created per unit of qty." ), } ); @@ -968,30 +968,24 @@ $.extend(erpnext.item, { if (has_batch) { if (!has_serial) { - fields.push({ fieldtype: "Section Break", label: __("Serial / Batch") }); + fields.push({ fieldtype: "Section Break", label: __("Serial Nos / Batches") }); } fields.push( { label: __("Automatically Create New Batch"), fieldname: "create_new_batch", fieldtype: "Check", - default: frm.doc.create_new_batch || 0, - description: __("Enable to auto-create a batch using the series below."), - onchange: function () { - const checked = dialog.get_value("create_new_batch"); - dialog.set_df_property("batch_number_series", "reqd", checked ? 1 : 0); - dialog.set_df_property("batch_number_series", "hidden", checked ? 0 : 1); - }, + default: 1, + read_only: 1, }, { label: __("Batch Number Series"), fieldname: "batch_number_series", fieldtype: "Data", default: frm.doc.batch_number_series || "", - reqd: frm.doc.create_new_batch ? 1 : 0, - hidden: frm.doc.create_new_batch ? 0 : 1, + reqd: 1, description: __( - "Example: BATCH-.YYYY.-.##### - A new batch will be auto-created from this series." + "Example: BATCH-.YYYY.-.#####. - A new batch will be auto-created from this series." ), } ); @@ -1019,18 +1013,6 @@ $.extend(erpnext.item, { callback: function (r) { if (!r.exc && r.message) { dialog.hide(); - frappe.show_alert( - { - message: __("Opening Stock entry created: {0}", [ - `${r.message}`, - ]), - indicator: "green", - }, - 8 - ); frm.reload_doc(); } }, diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index ed7886d6be3..8a458e8ea04 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -255,8 +255,6 @@ }, { "bold": 1, - "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)", - "description": "Used to create an opening Stock Entry with the Valuation Rate when the item is saved", "fieldname": "opening_stock", "fieldtype": "Float", "hidden": 1,