From 7e3a98ba334b0f5c965459848d6b79892ddec970 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 12:44:49 +0530 Subject: [PATCH 1/4] 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/4] 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 4803e817e9efbcaf910e60b37ff38d43a3ad48a3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 14:57:05 +0530 Subject: [PATCH 3/4] fix: bank guarantee, not able to select the purchase order --- erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js index 2a44cb3b52..0acbe2009f 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js @@ -43,8 +43,13 @@ frappe.ui.form.on('Bank Guarantee', { 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", From 946eefe039c46f0add94f6d88178e6cba0c2e892 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 23:10:36 +0530 Subject: [PATCH 4/4] 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 }); } - }) + }); }); }); }