From 140521da60ca278cfc73125b82addda90599c907 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Wed, 26 Oct 2016 15:20:22 +0530 Subject: [PATCH] Disabled reports will not be searchable from Awesome Bar --- .../js/frappe/ui/toolbar/awesome_bar.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js index b0c550ecaf..6c2abdf493 100644 --- a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js +++ b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js @@ -278,16 +278,17 @@ frappe.search.verbs = [ frappe.search.find(keys(frappe.boot.user.all_reports), txt, function(match) { var report = frappe.boot.user.all_reports[match]; var route = []; - if(report.report_type == "Report Builder") - route = ["Report", report.ref_doctype, match]; - else - route = ["query-report", match]; + if(!report.disabled) + if(report.report_type == "Report Builder") + route = ["Report", report.ref_doctype, match]; + else + route = ["query-report", match]; - return { - label: __("Report {0}", [__(match).bold()]), - value: __("Report {0}", [__(match)]), - route: route - } + return { + label: __("Report {0}", [__(match).bold()]), + value: __("Report {0}", [__(match)]), + route: route + } }); },