Merge branch 'develop' of https://github.com/frappe/erpnext into sla_fix
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
index 2a44cb3..0acbe20 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -43,8 +43,13 @@
 
 	reference_docname: function(frm) {
 		if (frm.doc.reference_docname && frm.doc.reference_doctype) {
-			let fields_to_fetch = ["project", "grand_total"];
+			let fields_to_fetch = ["grand_total"];
 			let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
+
+			if (frm.doc.reference_doctype == "Sales Order") {
+				fields_to_fetch.push("project");
+			}
+
 			fields_to_fetch.push(party_field);
 			frappe.call({
 				method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js
index 16c1d4d..fef4507 100644
--- a/erpnext/public/js/utils/dimension_tree_filter.js
+++ b/erpnext/public/js/utils/dimension_tree_filter.js
@@ -14,8 +14,12 @@
 		onload: function(frm) {
 			dimension_filters.then((dimensions) => {
 				dimensions.forEach((dimension) => {
-					frm.set_query(dimension['fieldname'],{
-						"is_group": 0
+					frappe.model.with_doctype(dimension['document_type'], () => {
+						if (frappe.meta.has_field(dimension['document_type'], 'is_group')) {
+							frm.set_query(dimension['fieldname'], {
+								"is_group": 0
+							});
+						}
 					});
 				});
 			});