fix: Is group filter for dimensions for doctype

This commit is contained in:
deepeshgarg007 2019-05-28 12:13:53 +05:30
parent 7dfffb5f73
commit 50ea99e35b
2 changed files with 26 additions and 1 deletions

View File

@ -48,7 +48,8 @@
"public/js/utils/customer_quick_entry.js",
"public/js/education/student_button.html",
"public/js/education/assessment_result_tool.html",
"public/js/hub/hub_factory.js"
"public/js/hub/hub_factory.js",
"public/js/utils/dimension_tree_filter.js"
],
"js/item-dashboard.min.js": [
"stock/dashboard/item_dashboard.html",

View File

@ -0,0 +1,24 @@
frappe.provide('frappe.ui.form');
let doclist = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
"Expense Claim", "Stock Entry", "Budget", "Payroll Entry", "Delivery Note", "Sales Invoice Item", "Purchase Invoice Item",
"Purchase Order Item", "Journal Entry Account", "Material Request Item", "Delivery Note Item", "Purchase Receipt Item",
"Stock Entry Detail", "Payment Entry Deduction", "Sales Taxes and Charges", "Purchase Taxes and Charges", "Shipping Rule",
"Landed Cost Item", "Asset Value Adjustment", "Loyalty Program", "Fee Schedule", "Fee Structure", "Stock Reconciliation",
"Travel Request", "Fees", "POS Profile"]
let dimension_filters = erpnext.get_dimension_filters()
doclist.forEach((doctype) => {
frappe.ui.form.on(doctype, {
onload: function(frm) {
dimension_filters.then((dimensions) => {
dimensions.forEach((dimension) => {
frm.set_query(dimension['fieldname'],{
"is_group": 0
});
});
});
}
});
})