fix: Show correct label instead of showing undefined (#18560)
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 39dda92..2e5f255 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -255,27 +255,44 @@
});
return;
} else {
- var fields = [
- {fieldtype:'Table', fieldname: 'items',
- description: __('Select BOM and Qty for Production'),
- fields: [
- {fieldtype:'Read Only', fieldname:'item_code',
- label: __('Item Code'), in_list_view:1},
- {fieldtype:'Link', fieldname:'bom', options: 'BOM', reqd: 1,
- label: __('Select BOM'), in_list_view:1, get_query: function(doc) {
- return {filters: {item: doc.item_code}};
- }},
- {fieldtype:'Float', fieldname:'pending_qty', reqd: 1,
- label: __('Qty'), in_list_view:1},
- {fieldtype:'Data', fieldname:'sales_order_item', reqd: 1,
- label: __('Sales Order Item'), hidden:1}
- ],
- data: r.message,
- get_data: function() {
- return r.message
+ const fields = [{
+ label: 'Items',
+ fieldtype: 'Table',
+ fieldname: 'items',
+ description: __('Select BOM and Qty for Production'),
+ fields: [{
+ fieldtype: 'Read Only',
+ fieldname: 'item_code',
+ label: __('Item Code'),
+ in_list_view: 1
+ }, {
+ fieldtype: 'Link',
+ fieldname: 'bom',
+ options: 'BOM',
+ reqd: 1,
+ label: __('Select BOM'),
+ in_list_view: 1,
+ get_query: function (doc) {
+ return { filters: { item: doc.item_code } };
}
+ }, {
+ fieldtype: 'Float',
+ fieldname: 'pending_qty',
+ reqd: 1,
+ label: __('Qty'),
+ in_list_view: 1
+ }, {
+ fieldtype: 'Data',
+ fieldname: 'sales_order_item',
+ reqd: 1,
+ label: __('Sales Order Item'),
+ hidden: 1
+ }],
+ data: r.message,
+ get_data: () => {
+ return r.message
}
- ]
+ }]
var d = new frappe.ui.Dialog({
title: __('Select Items to Manufacture'),
fields: fields,