[IMP] runbot: active trigger and filter manual

- dont display manual trigger having a team if not member of that team
- add an active field on triggers
This commit is contained in:
Xavier-Do 2022-08-17 16:46:08 +02:00
parent 326ac36b5e
commit b44ed5f7a6
3 changed files with 6 additions and 1 deletions

View File

@ -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):

View File

@ -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>

View File

@ -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"/>