Skip to content

Commit

Permalink
Merge pull request #23126 from frappe/version-13-hotfix
Browse files Browse the repository at this point in the history
chore: release v13
  • Loading branch information
ankush committed Nov 7, 2023
2 parents e910743 + 325e6a9 commit 3f2b86b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frappe/utils/global_search.py
Expand Up @@ -461,7 +461,9 @@ def search(text, start=0, limit=20, doctype=""):
results = []
sorted_results = []

allowed_doctypes = get_doctypes_for_global_search()
allowed_doctypes = set(get_doctypes_for_global_search()) & set(frappe.get_user().get_can_read())
if not allowed_doctypes or (doctype and doctype not in allowed_doctypes):
return []

for text in set(text.split("&")):
text = text.strip()
Expand All @@ -479,7 +481,7 @@ def search(text, start=0, limit=20, doctype=""):

if doctype:
query = query.where(global_search.doctype == doctype)
elif allowed_doctypes:
else:
query = query.where(global_search.doctype.isin(allowed_doctypes))

if cint(start) > 0:
Expand Down

0 comments on commit 3f2b86b

Please sign in to comment.