@@ -497,8 +497,10 @@ frappe.views.ListView = frappe.ui.BaseList.extend({ | |||||
} | } | ||||
} | } | ||||
this.list_header.find('.list-liked-by-me') | |||||
.toggleClass('text-extra-muted not-liked', !this.is_star_filtered()); | |||||
if(this.list_header) { | |||||
this.list_header.find('.list-liked-by-me') | |||||
.toggleClass('text-extra-muted not-liked', !this.is_star_filtered()); | |||||
} | |||||
this.last_updated_on = new Date(); | this.last_updated_on = new Date(); | ||||
this.dirty = false; | this.dirty = false; | ||||
@@ -189,16 +189,25 @@ frappe.ui.BaseList = Class.extend({ | |||||
options:this.doctype, | options:this.doctype, | ||||
label:'ID', | label:'ID', | ||||
fieldname:'name', | fieldname:'name', | ||||
onchange: () => { me.refresh(true); } | |||||
}); | }); | ||||
var has_standard_filters = false; | var has_standard_filters = false; | ||||
this.meta.fields.forEach(function(df) { | this.meta.fields.forEach(function(df) { | ||||
if(df.in_standard_filter) { | if(df.in_standard_filter) { | ||||
if(df.fieldtype == "Select") { | |||||
var options = df.options.split("\n") | |||||
if(options.length > 0 && options[0] != ""){ | |||||
options.unshift(""); | |||||
df.options = options.join("\n"); | |||||
} | |||||
} | |||||
me.page.add_field({ | me.page.add_field({ | ||||
fieldtype: df.fieldtype, | fieldtype: df.fieldtype, | ||||
label: __(df.label), | label: __(df.label), | ||||
options: df.options, | options: df.options, | ||||
fieldname: df.fieldname | |||||
fieldname: df.fieldname, | |||||
onchange: () => {me.refresh(true);} | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -260,7 +260,7 @@ frappe.views.ReportView = frappe.ui.BaseList.extend({ | |||||
// build args for query | // build args for query | ||||
get_args: function() { | get_args: function() { | ||||
let me = this; | let me = this; | ||||
let filters = this.filter_list.get_filters(); | |||||
let filters = this.filter_list? this.filter_list.get_filters(): []; | |||||
return { | return { | ||||
doctype: this.doctype, | doctype: this.doctype, | ||||
@@ -284,7 +284,7 @@ frappe.views.ReportView = frappe.ui.BaseList.extend({ | |||||
} | } | ||||
// second | // second | ||||
if(this.sort_by_next_select.val()) { | |||||
if(this.sort_by_next_select && this.sort_by_next_select.val()) { | |||||
order_by.push(this.get_selected_table_and_column(this.sort_by_next_select) | order_by.push(this.get_selected_table_and_column(this.sort_by_next_select) | ||||
+ ' ' + this.sort_order_next_select.val()); | + ' ' + this.sort_order_next_select.val()); | ||||
} | } | ||||
@@ -293,6 +293,10 @@ frappe.views.ReportView = frappe.ui.BaseList.extend({ | |||||
}, | }, | ||||
get_selected_table_and_column: function(select) { | get_selected_table_and_column: function(select) { | ||||
if(!select) { | |||||
return | |||||
} | |||||
return select.selected_doctype ? | return select.selected_doctype ? | ||||
this.get_full_column_name([select.selected_fieldname, select.selected_doctype]) : ""; | this.get_full_column_name([select.selected_fieldname, select.selected_doctype]) : ""; | ||||
}, | }, | ||||