diff --git a/frappe/__init__.py b/frappe/__init__.py index 52e9554be3..27a66e95ac 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -596,7 +596,7 @@ def get_hooks(hook=None, default=None, app_name=None): :param app_name: Filter by app.""" def load_app_hooks(app_name=None): hooks = {} - for app in [app_name] if app_name else get_installed_apps(): + for app in [app_name] if app_name else get_installed_apps(sort=True): app = "frappe" if app=="webnotes" else app try: app_hooks = get_module(app + ".hooks") diff --git a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js index f0b8d45c0e..39907dd589 100644 --- a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js +++ b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js @@ -137,7 +137,8 @@ frappe.search.verbs = [ var options = {}; options[search_field] = ["like", "%" + txt + "%"]; frappe.search.options.push({ - value: __('Find {0} in {1}', [""+txt+"", "" + route[1] + ""]), + label: __('Find {0} in {1}', [""+txt+"", "" + route[1] + ""]), + value: __('Find {0} in {1}', [txt, route[1]]), route_options: options, onclick: function() { frappe.container.page.doclistview.set_route_options(); @@ -159,7 +160,8 @@ frappe.search.verbs = [ var values = frappe.utils.unique(keys(locals[doctype]).concat(frappe.search.recent[doctype] || [])); var ret = frappe.search.find(values, txt, function(match) { return { - value: __(doctype) + " " + match + "", + label: __(doctype) + " " + match + "", + value: __(doctype) + " " + match, route: ["Form", doctype, match] } }); @@ -173,7 +175,8 @@ frappe.search.verbs = [ if(txt.split(" ")[0]==="new") { frappe.search.find(frappe.boot.user.can_create, txt.substr(4), function(match) { return { - value:__("New {0}", [""+match+""]), + label: __("New {0}", [""+match+""]), + value: __("New {0}", [match]), onclick: function() { new_doc(match); } } }); @@ -185,12 +188,14 @@ frappe.search.verbs = [ frappe.search.find(frappe.boot.user.can_read, txt, function(match) { if(in_list(frappe.boot.single_types, match)) { return { - value: __("{0}", [""+__(match)+""]), + label: __("{0}", [""+__(match)+""]), + value: __(match), route:["Form", match, match] } } else { return { - value: __("{0} List", [""+__(match)+""]), + label: __("{0} List", [""+__(match)+""]), + value: __("{0} List", [__(match)]), route:["List", match] } } @@ -201,7 +206,8 @@ frappe.search.verbs = [ function(txt) { frappe.search.find(keys(frappe.search.pages), txt, function(match) { return { - value: __("Open {0}", [""+__(match)+""]), + label: __("Open {0}", [""+__(match)+""]), + value: __("Open {0}", [__(match)]), route: [frappe.search.pages[match].route || frappe.search.pages[match].name] } }); @@ -211,7 +217,8 @@ frappe.search.verbs = [ function(txt) { frappe.search.find(keys(frappe.modules), txt, function(match) { ret = { - value: __("Open {0}", [""+__(match)+""]), + label: __("Open {0}", [""+__(match)+""]), + value: __("Open {0}", [__(match)]), } if(frappe.modules[match].link) { ret.route = [frappe.modules[match].link]; @@ -228,7 +235,8 @@ frappe.search.verbs = [ parts = txt.split(" in "); frappe.search.find(frappe.boot.user.can_read, parts[1], function(match) { return { - value: __('Find {0} in {1}', [""+__(parts[0])+"", ""+__(match)+""]), + label: __('Find {0} in {1}', [""+__(parts[0])+"", ""+__(match)+""]), + value: __('Find {0} in {1}', [__(parts[0]), __(match)]), route_options: {"name": ["like", "%" + parts[0] + "%"]}, route: ["List", match] } @@ -246,9 +254,10 @@ frappe.search.verbs = [ try { var val = eval(txt); - var formatted_value = $.format('{0} = {1}', [txt, ""+val+""]); + var formatted_value = __('{0} = {1}', [txt, ""+val+""]); frappe.search.options.push({ - value: formatted_value, + label: formatted_value, + value: __('{0} = {1}', [txt, val]), match: val, onclick: function(match) { msgprint(formatted_value, "Result");