fix: clear all filters when in list view

This commit is contained in:
barredterra 2023-03-14 16:47:57 +01:00
parent 985a8ca18a
commit c1e20c84b4

View file

@ -128,7 +128,14 @@ frappe.ui.FilterGroup = class {
this.wrapper.find(".clear-filters").on("click", () => {
this.toggle_empty_filters(true);
this.clear_filters();
if (typeof this.base_list !== "undefined") {
// It's a list view. Clear all the filters, also the ones in the
// FilterArea outside this FilterGroup
this.base_list.filter_area.clear();
} else {
// Not a list view, just clear the filters in this FilterGroup
this.clear_filters();
}
this.on_change();
});