From a674d9216af960d50a10ac75c755978d517beb0a Mon Sep 17 00:00:00 2001 From: Dipen Gala Date: Wed, 17 Jun 2026 13:22:34 +0530 Subject: [PATCH] fix: filter purchase_person dropdown to non-group enabled records only Adds a set_query on purchase_person in the purchase_team child table so the dropdown excludes group nodes (like "Purchase Team") and disabled records, matching the same filter used for sales_person in Sales Team. Co-Authored-By: Claude Sonnet 4.6 --- erpnext/public/js/controllers/buying.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 317f3ad5410..4d6ac2cfb85 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -87,6 +87,15 @@ erpnext.buying = { me.frm.set_query("supplier_address", erpnext.queries.address_query); me.frm.set_query("billing_address", erpnext.queries.company_address_query); + + me.frm.set_query("purchase_person", "purchase_team", function () { + return { + filters: { + is_group: 0, + enabled: 1, + }, + }; + }); erpnext.accounts.dimensions.setup_dimension_filters(me.frm, me.frm.doctype); this.frm.set_query("item_code", "items", function () {