From 72d03464dcc584885738d6e7a634264ad49bbc21 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 30 Jul 2019 11:56:24 +0530 Subject: [PATCH] fix: Show "Get Item Location" only if there are reference items --- erpnext/stock/doctype/pick_ticket/pick_ticket.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/erpnext/stock/doctype/pick_ticket/pick_ticket.js b/erpnext/stock/doctype/pick_ticket/pick_ticket.js index 87fad7f9eed..5903e6fea03 100644 --- a/erpnext/stock/doctype/pick_ticket/pick_ticket.js +++ b/erpnext/stock/doctype/pick_ticket/pick_ticket.js @@ -27,13 +27,11 @@ frappe.ui.form.on('Pick Ticket', { }); }, __("Get items from")); - frm.add_custom_button(__('Get Item Locations'), () => { - frm.trigger('set_item_locations'); - }); + if (frm.doc.reference_document_items.length) { + frm.add_custom_button(__('Get Item Locations'), () => { + frm.call('set_item_locations'); + }); + } }, - set_item_locations: (frm) => { - frm.call('set_item_locations') - } - });