fix: transform filter correctly to match route options
This commit is contained in:
parent
9b24450337
commit
231289c233
1 changed files with 10 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ frappe.ui.sidebar_item.TypeLink = class SidebarItem {
|
|||
let filters_json = JSON.parse(
|
||||
frappe.utils.get_filter_as_json(JSON.parse(this.item.filters))
|
||||
);
|
||||
filters_json = this.transform_filters(filters_json);
|
||||
if (this.item.link_type == "DocType") {
|
||||
args.doc_view = "List";
|
||||
args.route_options = filters_json;
|
||||
|
|
@ -72,6 +73,15 @@ frappe.ui.sidebar_item.TypeLink = class SidebarItem {
|
|||
return encodeURI(path);
|
||||
}
|
||||
}
|
||||
transform_filters(filters_json) {
|
||||
for (const [key, value] of Object.entries(filters_json)) {
|
||||
if (Array.isArray(value)) {
|
||||
filters_json[key] = value[1];
|
||||
}
|
||||
}
|
||||
return filters_json;
|
||||
}
|
||||
|
||||
prepare() {}
|
||||
make() {
|
||||
this.path = this.get_path();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue