fix: show correct view label in awesomebar for tree-view doctypes
This commit is contained in:
parent
b0995bd4a0
commit
0722222b8d
2 changed files with 9 additions and 1 deletions
|
|
@ -68,6 +68,7 @@ def get_bootinfo():
|
|||
bootinfo.nested_set_doctypes = [
|
||||
d.parent for d in frappe.get_all("DocField", {"fieldname": "lft"}, ["parent"])
|
||||
]
|
||||
bootinfo.tree_view_doctypes = [d.name for d in frappe.get_all("DocType", {"default_view": "Tree"})]
|
||||
add_home_page(bootinfo, doclist)
|
||||
bootinfo.page_info = get_allowed_pages()
|
||||
load_translations(bootinfo)
|
||||
|
|
|
|||
|
|
@ -235,7 +235,14 @@ frappe.search.utils = {
|
|||
});
|
||||
}
|
||||
|
||||
out.push(option("List", ["List", item], 0.05));
|
||||
const isTree = (frappe.boot.tree_view_doctypes || []).includes(item);
|
||||
out.push(
|
||||
option(
|
||||
isTree ? "Tree" : "List",
|
||||
isTree ? ["Tree", item] : ["List", item],
|
||||
0.05
|
||||
)
|
||||
);
|
||||
if (frappe.model.can_get_report(item)) {
|
||||
out.push(option("Report", ["List", item, "Report"], 0.04));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue