From c2037202329d115c86fd6100ac2a69113dc7bd79 Mon Sep 17 00:00:00 2001 From: UmakanthKaspa Date: Mon, 13 Jan 2025 14:46:53 +0000 Subject: [PATCH] feat: show item name alongside item code in the update items dialog --- erpnext/public/js/utils.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 0da2dbb71c91..c399fca7bf4a 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -622,6 +622,7 @@ erpnext.utils.update_child_items = function (opts) { docname: d.name, name: d.name, item_code: d.item_code, + item_name: d.item_name, delivery_date: d.delivery_date, schedule_date: d.schedule_date, conversion_factor: d.conversion_factor, @@ -668,6 +669,29 @@ erpnext.utils.update_child_items = function (opts) { filters: filters, }; }, + change: function () { + const item_code = this.value; + if (item_code) { + frappe.db.get_value("Item", item_code, "item_name", (r) => { + if (r && r.item_name) { + const idx = this.doc.idx; + dialog.fields_dict.trans_items.df.data.some((doc) => { + if (doc.idx === idx) { + doc.item_name = r.item_name; + dialog.fields_dict.trans_items.grid.refresh(); + return true; + } + }); + } + }); + } + }, + }, + { + fieldtype: "Data", + fieldname: "item_name", + label: __("Item Name"), + read_only: 1, }, { fieldtype: "Link",