From e08805128b9085db31261240fbf8ad1410feba15 Mon Sep 17 00:00:00 2001 From: ravibharathi656 Date: Tue, 2 Dec 2025 14:07:16 +0530 Subject: [PATCH] fix: exclude is_group records --- erpnext/buying/doctype/supplier/supplier.js | 8 ++++++++ erpnext/selling/doctype/customer/customer.js | 16 ++++++++++++++++ .../doctype/customer_group/customer_group.json | 5 +++-- erpnext/setup/doctype/item_group/item_group.json | 5 +++-- .../doctype/supplier_group/supplier_group.json | 6 ++++-- erpnext/setup/doctype/territory/territory.json | 6 ++++-- erpnext/stock/doctype/item/item.js | 7 +++++++ 7 files changed, 45 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index fb4ef867ade..4b46ddc3d80 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -135,6 +135,14 @@ frappe.ui.form.on("Supplier", { // indicators erpnext.utils.set_party_dashboard_indicators(frm); } + + frm.set_query("supplier_group", () => { + return { + filters: { + is_group: 0, + }, + }; + }); }, get_supplier_group_details: function (frm) { frappe.call({ diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 9864beeffa5..42f12507c1c 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -215,6 +215,22 @@ frappe.ui.form.on("Customer", { var grid = cur_frm.get_field("sales_team").grid; grid.set_column_disp("allocated_amount", false); grid.set_column_disp("incentives", false); + + frm.set_query("customer_group", () => { + return { + filters: { + is_group: 0, + }, + }; + }); + + frm.set_query("territory", () => { + return { + filters: { + is_group: 0, + }, + }; + }); }, validate: function (frm) { if (frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name); diff --git a/erpnext/setup/doctype/customer_group/customer_group.json b/erpnext/setup/doctype/customer_group/customer_group.json index a2ef8812476..40317c2f8f7 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.json +++ b/erpnext/setup/doctype/customer_group/customer_group.json @@ -140,7 +140,7 @@ "idx": 1, "is_tree": 1, "links": [], - "modified": "2025-01-22 10:48:10.186637", + "modified": "2025-12-02 13:58:03.378607", "modified_by": "Administrator", "module": "Setup", "name": "Customer Group", @@ -209,10 +209,11 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_customer_group", "show_name_in_global_search": 1, "sort_field": "creation", "sort_order": "DESC", "states": [], "translated_doctype": 1 -} \ No newline at end of file +} diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json index a5008af25c7..9fb8dc10aa9 100644 --- a/erpnext/setup/doctype/item_group/item_group.json +++ b/erpnext/setup/doctype/item_group/item_group.json @@ -136,7 +136,7 @@ "is_tree": 1, "links": [], "max_attachments": 3, - "modified": "2025-01-22 10:46:09.450137", + "modified": "2025-12-02 13:58:30.018021", "modified_by": "Administrator", "module": "Setup", "name": "Item Group", @@ -203,10 +203,11 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_item_group", "show_name_in_global_search": 1, "sort_field": "creation", "sort_order": "DESC", "states": [], "translated_doctype": 1 -} \ No newline at end of file +} diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.json b/erpnext/setup/doctype/supplier_group/supplier_group.json index 04e8e07f019..4811ad84992 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group.json +++ b/erpnext/setup/doctype/supplier_group/supplier_group.json @@ -42,6 +42,7 @@ { "bold": 1, "default": "0", + "description": "Only leaf nodes are allowed in transaction", "fieldname": "is_group", "fieldtype": "Check", "in_list_view": 1, @@ -108,7 +109,7 @@ "idx": 1, "is_tree": 1, "links": [], - "modified": "2025-01-22 10:49:27.066443", + "modified": "2025-12-02 13:57:57.814686", "modified_by": "Administrator", "module": "Setup", "name": "Supplier Group", @@ -168,9 +169,10 @@ "share": 1 } ], + "row_format": "Dynamic", "show_name_in_global_search": 1, "sort_field": "creation", "sort_order": "ASC", "states": [], "translated_doctype": 1 -} \ No newline at end of file +} diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json index 0b07f72e469..b7d9c589dab 100644 --- a/erpnext/setup/doctype/territory/territory.json +++ b/erpnext/setup/doctype/territory/territory.json @@ -46,6 +46,7 @@ { "bold": 1, "default": "0", + "description": "Only leaf nodes are allowed in transaction", "fieldname": "is_group", "fieldtype": "Check", "in_list_view": 1, @@ -123,7 +124,7 @@ "idx": 1, "is_tree": 1, "links": [], - "modified": "2024-08-16 19:21:19.161490", + "modified": "2025-12-02 13:58:55.190485", "modified_by": "Administrator", "module": "Setup", "name": "Territory", @@ -184,10 +185,11 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_territory,territory_manager", "show_name_in_global_search": 1, "sort_field": "creation", "sort_order": "DESC", "states": [], "translated_doctype": 1 -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 09f4c1710bd..52d9d83bdb3 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -232,6 +232,13 @@ frappe.ui.form.on("Item", { }); frm.toggle_reqd("customer", frm.doc.is_customer_provided_item ? 1 : 0); + frm.set_query("item_group", () => { + return { + filters: { + is_group: 0, + }, + }; + }); }, validate: function (frm) {