From abb210bd18358149e77fa16dd08578c823efd6e1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 18:22:20 +0000 Subject: [PATCH] refactor: add supplier filter in buying (backport #50013) (#50107) * refactor: add supplier filter in buying (cherry picked from commit 108b108d645b169695513a73afcd415380921a14) # Conflicts: # erpnext/public/js/controllers/buying.js * chore: resolve conflicts --------- Co-authored-by: manikandan-s-18 Co-authored-by: Mihir Kandoi --- erpnext/public/js/controllers/buying.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 8c0be8042ac..e0e68c37451 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -17,7 +17,17 @@ erpnext.buying = { this.setup_queries(doc, cdt, cdn); super.onload(); - this.frm.set_query('shipping_rule', function() { + if (["Purchase Order", "Purchase Receipt", "Purchase Invoice"].includes(this.frm.doctype)) { + this.frm.set_query("supplier", function () { + return { + filters: { + is_transporter: 0, + }, + }; + }); + } + + this.frm.set_query("shipping_rule", function () { return { filters: { "shipping_rule_type": "Buying"