fix: Show "Get Item Location" only if there are reference items
diff --git a/erpnext/stock/doctype/pick_ticket/pick_ticket.js b/erpnext/stock/doctype/pick_ticket/pick_ticket.js
index 87fad7f..5903e6f 100644
--- a/erpnext/stock/doctype/pick_ticket/pick_ticket.js
+++ b/erpnext/stock/doctype/pick_ticket/pick_ticket.js
@@ -27,13 +27,11 @@
});
}, __("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')
- }
-
});