From 231289c2332f73eb8a09eed026d7da09ea89c3d2 Mon Sep 17 00:00:00 2001 From: sokumon Date: Thu, 5 Feb 2026 14:23:05 +0530 Subject: [PATCH] fix: transform filter correctly to match route options --- frappe/public/js/frappe/ui/sidebar/sidebar_item.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frappe/public/js/frappe/ui/sidebar/sidebar_item.js b/frappe/public/js/frappe/ui/sidebar/sidebar_item.js index 01400105d6..067af8afb3 100644 --- a/frappe/public/js/frappe/ui/sidebar/sidebar_item.js +++ b/frappe/public/js/frappe/ui/sidebar/sidebar_item.js @@ -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();