Skip to content

Commit

Permalink
feat: show item name alongside item code in the update items dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
UmakanthKaspa committed Jan 13, 2025
1 parent e529f82 commit c203720
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions erpnext/public/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c203720

Please sign in to comment.