mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: allow to filter team errors by trigger
This commit is contained in:
parent
e12ca13ff5
commit
72686091e8
@ -471,7 +471,6 @@ class Runbot(Controller):
|
||||
|
||||
# Sort & Filter
|
||||
sortby = kwargs.get('sortby', 'count')
|
||||
filterby = kwargs.get('filterby', 'not_one')
|
||||
searchbar_sortings = {
|
||||
'date': {'label': 'Recently Seen', 'order': 'last_seen_date desc'},
|
||||
'count': {'label': 'Nb Seen', 'order': 'build_count desc'},
|
||||
@ -482,6 +481,16 @@ class Runbot(Controller):
|
||||
'unassigned': {'label': 'Unassigned', 'domain': [('responsible', '=', False)]},
|
||||
'not_one': {'label': 'Seen more than once', 'domain': [('build_count', '>', 1)]},
|
||||
}
|
||||
|
||||
for trigger in team.build_error_ids.trigger_ids if team else []:
|
||||
k = f'trigger_{trigger.name.lower().replace(" ", "_")}'
|
||||
searchbar_filters.update(
|
||||
{k: {'label': f'Trigger {trigger.name}', 'domain': [('trigger_ids', '=', trigger.id)]}}
|
||||
)
|
||||
|
||||
filterby = kwargs.get('filterby', 'not_one')
|
||||
if filterby not in searchbar_filters:
|
||||
filterby = 'not_one'
|
||||
domain = expression.AND([domain, searchbar_filters[filterby]['domain']])
|
||||
|
||||
qctx = {
|
||||
|
@ -9,6 +9,7 @@
|
||||
<div class="col">Last seen date</div>
|
||||
<div class="col col-md-3">Module</div>
|
||||
<div class="col col-md-5">Summary</div>
|
||||
<div class="col">Triggers</div>
|
||||
<div class="col">Assigned to</div>
|
||||
<div class="col">&nbsp;</div>
|
||||
</div>
|
||||
@ -26,6 +27,11 @@
|
||||
</button>
|
||||
<code><t t-esc="build_error.summary"/></code>
|
||||
</div>
|
||||
<div class="col">
|
||||
<t t-foreach="build_error.trigger_ids" t-as="trigger">
|
||||
<span class="badge badge-pill badge-light small"><t t-esc="trigger.name"/></span>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col">
|
||||
<t t-if="build_error.responsible" t-esc="build_error.responsible.name"/>
|
||||
<a t-else="" t-attf-href="/runbot/errors/assign/{{build_error.id}}" data-runbot="action" role="button" class="btn btn-primary btn-sm">Assign to me</a>
|
||||
|
Loading…
Reference in New Issue
Block a user