diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index 2615d22e0f..855316e935 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -468,15 +468,19 @@ frappe.views.ListSidebar = Class.extend({ .on("click", ".stat-link", function() { var fieldname = $(this).attr('data-field'); var label = $(this).attr('data-label'); - if (label == "No Tags") { - label = "%,%"; - } + var condition = "like"; var existing = me.list_view.filter_area.filter_list.get_filter(fieldname); if(existing) { existing.remove(); } - me.list_view.filter_area.filter_list.add_filter(me.list_view.doctype, fieldname, 'not like', label); - me.list_view.refresh(); + if (label == "No Tags") { + label = "%,%"; + condition = "not like"; + } + me.list_view.filter_area.filter_list.add_filter(me.list_view.doctype, fieldname, condition, label) + .then(function() { + me.list_view.refresh(); + }); }) .insertBefore(this.sidebar.find(".close-sidebar-button")); },