mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: improve frontend search
When filtering bundles in the frontend, the user is not able to search for its final trigram because of the `like`search. With this commit, if the search contains a `%` symbol, the `=like` operator is used permitting more accurate searches.
This commit is contained in:
parent
2421a24f78
commit
f6eb23f896
@ -142,7 +142,8 @@ class Runbot(Controller):
|
||||
for search_elem in search.split("|"):
|
||||
if search_elem.isnumeric():
|
||||
pr_numbers.append(int(search_elem))
|
||||
search_domains.append([('name', 'like', search_elem)])
|
||||
operator = '=like' if '%' in search_elem else 'like'
|
||||
search_domains.append([('name', operator, search_elem)])
|
||||
if pr_numbers:
|
||||
res = request.env['runbot.branch'].search([('name', 'in', pr_numbers)])
|
||||
if res:
|
||||
|
Loading…
Reference in New Issue
Block a user