Merge pull request #22760 from ankush/filters

fix(UX): Preserve filters between list and report views
This commit is contained in:
Ankush Menat 2023-10-17 11:39:06 +05:30 committed by GitHub
commit 33cd599356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -40,6 +40,11 @@ frappe.views.ListViewSelect = class ListViewSelect {
set_route(view, calendar_name) {
const route = [this.slug(), "view", view];
if (calendar_name) route.push(calendar_name);
let search_params = cur_list?.get_search_params();
if (search_params) {
frappe.route_options = Object.fromEntries(search_params);
}
frappe.set_route(route);
}

View file

@ -427,7 +427,7 @@ frappe.ui.GroupBy = class {
}
get_group_by_field_label() {
let field = this.group_by_fields[this.group_by_doctype].find(
let field = this.group_by_fields[this.group_by_doctype]?.find(
(field) => field.fieldname == this.group_by_field
);
return field?.label || field?.fieldname;