From 2a04261b9e96da561f2d9c37081ba43b0f7d0813 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 23 Aug 2018 09:24:01 +0200 Subject: [PATCH] [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|... --- runbot/controllers/frontend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index f0b3c718..d2519fa1 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -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 = [], {}