Skip to content

Commit

Permalink
[IMP] runbot: active trigger and filter manual
Browse files Browse the repository at this point in the history
- dont display manual trigger having a team if not member of that team
- add an active field on triggers
  • Loading branch information
Xavier-Do committed Aug 17, 2022
1 parent 326ac36 commit b44ed5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions runbot/models/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Trigger(models.Model):
has_stats = fields.Boolean('Has a make_stats config step', compute="_compute_has_stats", store=True)

team_ids = fields.Many2many('runbot.team', string="Runbot Teams", help="Teams responsible of this trigger, mainly usefull for nightly")
active = fields.Boolean("Active", default=True)

@api.depends('config_id.step_order_ids.step_id.make_stats')
def _compute_has_stats(self):
Expand Down
4 changes: 3 additions & 1 deletion runbot/templates/batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
<td>Manual</td>
<td>
<t t-foreach="batch.slot_ids.filtered(lambda s: s.trigger_id.manual)" t-as="slot">
<t t-call="runbot.slot_button"/>
<t t-if="slot.build_id or (not slot.trigger_id.team_ids) or (user_id in slot.trigger_id.team_ids.user_ids)">
<t t-call="runbot.slot_button"/>
</t>
</t>
</td>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions runbot/views/repo_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<header>
</header>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group name="repo_group">
<field name="active" invisible="1"/>
<field name="name"/>
<field name="sequence"/>
<field name="description"/>
Expand Down

0 comments on commit b44ed5f

Please sign in to comment.