From a444325bd167abbc99a62b30e367a66f9463b970 Mon Sep 17 00:00:00 2001 From: ravibharathi656 Date: Tue, 2 Dec 2025 14:07:16 +0530 Subject: [PATCH 1/2] fix: exclude is_group records (cherry picked from commit e08805128b9085db31261240fbf8ad1410feba15) # Conflicts: # erpnext/setup/doctype/customer_group/customer_group.json # erpnext/setup/doctype/item_group/item_group.json # erpnext/setup/doctype/supplier_group/supplier_group.json # erpnext/setup/doctype/territory/territory.json --- erpnext/buying/doctype/supplier/supplier.js | 8 ++++++++ erpnext/selling/doctype/customer/customer.js | 16 ++++++++++++++++ .../doctype/customer_group/customer_group.json | 13 ++++++++++++- erpnext/setup/doctype/item_group/item_group.json | 13 ++++++++++++- .../doctype/supplier_group/supplier_group.json | 14 +++++++++++++- erpnext/setup/doctype/territory/territory.json | 14 +++++++++++++- erpnext/stock/doctype/item/item.js | 7 +++++++ 7 files changed, 81 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index a27244d1528..e04ac2ce302 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -139,6 +139,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 f5a2009e551..1b75bd1fbfc 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -200,6 +200,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 4c36bc77abe..0c51be55545 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.json +++ b/erpnext/setup/doctype/customer_group/customer_group.json @@ -139,7 +139,11 @@ "idx": 1, "is_tree": 1, "links": [], +<<<<<<< HEAD "modified": "2023-06-02 13:40:34.435822", +======= + "modified": "2025-12-02 13:58:03.378607", +>>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Customer Group", @@ -208,9 +212,16 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_customer_group", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", +<<<<<<< HEAD "states": [] -} \ No newline at end of file +} +======= + "states": [], + "translated_doctype": 1 +} +>>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json index 7c9233fa1f3..189347880d2 100644 --- a/erpnext/setup/doctype/item_group/item_group.json +++ b/erpnext/setup/doctype/item_group/item_group.json @@ -135,7 +135,11 @@ "is_tree": 1, "links": [], "max_attachments": 3, +<<<<<<< HEAD "modified": "2024-01-30 14:08:38.485616", +======= + "modified": "2025-12-02 13:58:30.018021", +>>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Item Group", @@ -202,9 +206,16 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_item_group", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", +<<<<<<< HEAD "states": [] -} \ No newline at end of file +} +======= + "states": [], + "translated_doctype": 1 +} +>>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.json b/erpnext/setup/doctype/supplier_group/supplier_group.json index b3ed608cd03..0edfdf8c802 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group.json +++ b/erpnext/setup/doctype/supplier_group/supplier_group.json @@ -41,6 +41,7 @@ { "bold": 1, "default": "0", + "description": "Only leaf nodes are allowed in transaction", "fieldname": "is_group", "fieldtype": "Check", "in_list_view": 1, @@ -107,7 +108,11 @@ "idx": 1, "is_tree": 1, "links": [], +<<<<<<< HEAD "modified": "2022-12-24 11:16:12.486719", +======= + "modified": "2025-12-02 13:57:57.814686", +>>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Supplier Group", @@ -168,8 +173,15 @@ "share": 1 } ], + "row_format": "Dynamic", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "ASC", +<<<<<<< HEAD "states": [] -} \ No newline at end of file +} +======= + "states": [], + "translated_doctype": 1 +} +>>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json index c3a49933746..c0cfb79a611 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,11 @@ "idx": 1, "is_tree": 1, "links": [], +<<<<<<< HEAD "modified": "2022-12-24 11:16:39.964956", +======= + "modified": "2025-12-02 13:58:55.190485", +>>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Territory", @@ -186,9 +191,16 @@ "share": 1 } ], + "row_format": "Dynamic", "search_fields": "parent_territory,territory_manager", "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", +<<<<<<< HEAD "states": [] -} \ No newline at end of file +} +======= + "states": [], + "translated_doctype": 1 +} +>>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index dd89d204cfb..2cea6463592 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -226,6 +226,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) { From 020db922b7596de6c479338e4728223efd180e39 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Tue, 2 Dec 2025 20:56:54 +0530 Subject: [PATCH 2/2] chore: resolve conflicts --- erpnext/setup/doctype/customer_group/customer_group.json | 9 --------- erpnext/setup/doctype/item_group/item_group.json | 9 --------- erpnext/setup/doctype/supplier_group/supplier_group.json | 9 --------- erpnext/setup/doctype/territory/territory.json | 9 --------- 4 files changed, 36 deletions(-) diff --git a/erpnext/setup/doctype/customer_group/customer_group.json b/erpnext/setup/doctype/customer_group/customer_group.json index 0c51be55545..7e740aacbc4 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.json +++ b/erpnext/setup/doctype/customer_group/customer_group.json @@ -139,11 +139,7 @@ "idx": 1, "is_tree": 1, "links": [], -<<<<<<< HEAD - "modified": "2023-06-02 13:40:34.435822", -======= "modified": "2025-12-02 13:58:03.378607", ->>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Customer Group", @@ -217,11 +213,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", -<<<<<<< HEAD - "states": [] -} -======= "states": [], "translated_doctype": 1 } ->>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json index 189347880d2..763712a70ca 100644 --- a/erpnext/setup/doctype/item_group/item_group.json +++ b/erpnext/setup/doctype/item_group/item_group.json @@ -135,11 +135,7 @@ "is_tree": 1, "links": [], "max_attachments": 3, -<<<<<<< HEAD - "modified": "2024-01-30 14:08:38.485616", -======= "modified": "2025-12-02 13:58:30.018021", ->>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Item Group", @@ -211,11 +207,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", -<<<<<<< HEAD - "states": [] -} -======= "states": [], "translated_doctype": 1 } ->>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.json b/erpnext/setup/doctype/supplier_group/supplier_group.json index 0edfdf8c802..c93572fd3a3 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group.json +++ b/erpnext/setup/doctype/supplier_group/supplier_group.json @@ -108,11 +108,7 @@ "idx": 1, "is_tree": 1, "links": [], -<<<<<<< HEAD - "modified": "2022-12-24 11:16:12.486719", -======= "modified": "2025-12-02 13:57:57.814686", ->>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Supplier Group", @@ -177,11 +173,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "ASC", -<<<<<<< HEAD - "states": [] -} -======= "states": [], "translated_doctype": 1 } ->>>>>>> e08805128b (fix: exclude is_group records) diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json index c0cfb79a611..8aa6d1e204c 100644 --- a/erpnext/setup/doctype/territory/territory.json +++ b/erpnext/setup/doctype/territory/territory.json @@ -124,11 +124,7 @@ "idx": 1, "is_tree": 1, "links": [], -<<<<<<< HEAD - "modified": "2022-12-24 11:16:39.964956", -======= "modified": "2025-12-02 13:58:55.190485", ->>>>>>> e08805128b (fix: exclude is_group records) "modified_by": "Administrator", "module": "Setup", "name": "Territory", @@ -196,11 +192,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", -<<<<<<< HEAD - "states": [] -} -======= "states": [], "translated_doctype": 1 } ->>>>>>> e08805128b (fix: exclude is_group records)