fix: conditionally apply `is_group` filter in accounting dimension query (#40414)

diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 0d64188..bb1ed35 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -670,7 +670,7 @@
 	searchfields = frappe.get_meta(doctype).get_search_fields()
 
 	meta = frappe.get_meta(doctype)
-	if meta.is_tree:
+	if meta.is_tree and meta.has_field("is_group"):
 		query_filters.append(["is_group", "=", 0])
 
 	if meta.has_field("disabled"):