[IMP] runbot: add warning on some config_views

the warning will appear on build
This is useful to explain the purpose of the build and special
attention to give when reading the result. (templates)
This commit is contained in:
Xavier-Do 2025-03-10 15:36:45 +01:00
parent e44ac41a19
commit 8459445884
3 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class Config(models.Model):
group = fields.Many2one('runbot.build.config', 'Configuration group', help="Group of config's and config steps") group = fields.Many2one('runbot.build.config', 'Configuration group', help="Group of config's and config steps")
group_name = fields.Char('Group name', related='group.name') group_name = fields.Char('Group name', related='group.name')
step_ids = fields.Many2many('runbot.build.config.step', compute='_compute_step_ids') step_ids = fields.Many2many('runbot.build.config.step', compute='_compute_step_ids')
warning = fields.Html('Warning message', help="Warning message to display on build page")
@api.model_create_multi @api.model_create_multi
def create(self, vals_list): def create(self, vals_list):

View File

@ -234,6 +234,14 @@
</table> </table>
</div> </div>
<t t-set="nb_subbuild" t-value="len(build.children_ids)"/> <t t-set="nb_subbuild" t-value="len(build.children_ids)"/>
<t t-set="warning" t-value="([b.config_id.warning for b in build.ancestors if b.config_id.warning] + [''])[0]"/>
<div class="col-md-12" t-if="warning">
<div class="row">
<div t-attf-class="alert alert-warning text-center">
<b t-out="warning"/>
</div>
</div>
</div>
<div class="col-md-12"> <div class="col-md-12">
<table class="table table-condensed"> <table class="table table-condensed">
<tr> <tr>

View File

@ -20,6 +20,7 @@
</field> </field>
<field name="protected"/> <field name="protected"/>
<field name="group" groups="base.group_no_one"/> <field name="group" groups="base.group_no_one"/>
<field name="warning"/>
</group> </group>
</sheet> </sheet>
<chatter/> <chatter/>