From 7e3a98ba334b0f5c965459848d6b79892ddec970 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 12:44:49 +0530 Subject: [PATCH 1/3] fix: Is group filter fixes in dimensions --- erpnext/public/js/utils/dimension_tree_filter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index 16c1d4d248..f31b578b0b 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -14,9 +14,13 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { 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 + }); + } + }) }); }); } From d1e0f42fea2937d95e595534d023b9cc4a4914cd Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 12:47:39 +0530 Subject: [PATCH 2/3] fix: Styling fix --- erpnext/public/js/utils/dimension_tree_filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index f31b578b0b..ccca04df26 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -16,7 +16,7 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { dimensions.forEach((dimension) => { frappe.model.with_doctype(dimension['document_type'], () => { if (frappe.meta.has_field(dimension['document_type'], 'is_group')) { - frm.set_query(dimension['fieldname'],{ + frm.set_query(dimension['fieldname'], { "is_group": 0 }); } From 946eefe039c46f0add94f6d88178e6cba0c2e892 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 23:10:36 +0530 Subject: [PATCH 3/3] fix: Codacy fixes --- erpnext/public/js/utils/dimension_tree_filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index ccca04df26..fef450795b 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -20,7 +20,7 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { "is_group": 0 }); } - }) + }); }); }); }