fix: Don't show no value type fields in options for custom columns (#7497)

* fix: Don't show no value type fields in options for custom columns

* fix: Use filter instead of pushing in list
This commit is contained in:
Deepesh Garg 2019-05-15 15:41:50 +05:30 committed by Faris Ansari
parent e694c73c53
commit f01f36b6e5

View file

@ -992,9 +992,11 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
change: () => {
let doctype = d.get_value('doctype');
frappe.model.with_doctype(doctype, () => {
let fields = frappe.meta.get_docfields(doctype)
let options = frappe.meta.get_docfields(doctype)
.filter(frappe.model.is_value_type)
.map(df => ({ label: df.label, value: df.fieldname }));
d.set_df_property('field', 'options', fields);
d.set_df_property('field', 'options', options);
});
}