Skip to content

Commit

Permalink
fix: replace comma to the blank value
Browse files Browse the repository at this point in the history
  • Loading branch information
bansodegaurav8848 committed Oct 31, 2024
1 parent 9865091 commit 664d531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/desk/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def search_widget(
order_by = f"`tab{doctype}`.idx desc, {order_by_based_on_meta}"

if not meta.translated_doctype:
_txt = frappe.db.escape((txt or "").replace("%", "").replace("@", ""))
_txt = frappe.db.escape((txt or "").replace("%", "").replace("@", "").replace(",",""))
# locate returns 0 if string is not found, convert 0 to null and then sort null to end in order by
_relevance = f"(1 / nullif(locate({_txt}, `tab{doctype}`.`name`), 0))"
formatted_fields.append(f"""{_relevance} as `_relevance`""")
Expand Down

0 comments on commit 664d531

Please sign in to comment.