[IMP] runbot: allow to search multi terms with |

With this feature you can easily search your branch and branch from your team; or your features...

Eg: jke|-website or -jke|-rde|-qsm|...
This commit is contained in:
Jeremy Kersten 2018-08-23 09:24:01 +02:00
parent cfba7da06d
commit 2a04261b9e

View File

@ -76,7 +76,8 @@ class Runbot(http.Controller):
domain = [('repo_id', '=', repo.id)]
domain += [('state', '!=', key) for key, value in iter(filters.items()) if value == '0']
if search:
domain += ['|', '|', ('dest', 'ilike', search), ('subject', 'ilike', search), ('branch_id.branch_name', 'ilike', search)]
for to_search in search.split('|'):
domain += ['|', '|', '|', ('dest', 'ilike', to_search), ('subject', 'ilike', to_search), ('branch_id.branch_name', 'ilike', to_search)]
build_ids = build_obj.search(domain, limit=int(limit))
branch_ids, build_by_branch_ids = [], {}