From e45102b91325d7fb64f97de8ee23e60527d56958 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 2 Aug 2019 21:46:28 +0530 Subject: [PATCH] fix: Show correct label instead of showing undefined (#18560) --- .../doctype/sales_order/sales_order.js | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 39dda92e3e..2e5f255a90 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -255,27 +255,44 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( }); 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,