[IMP] runbot: show bundles that use a Dockerfile

Before manipulating a Dockerfile, it can be useful to know which bundle
is using it.
This commit is contained in:
Christophe Monniez 2021-06-24 14:57:45 +02:00 committed by xdo
parent 67d020a8b3
commit b015ec6840
2 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class Dockerfile(models.Model):
version_ids = fields.One2many('runbot.version', 'dockerfile_id', string='Versions')
description = fields.Text('Description')
view_ids = fields.Many2many('ir.ui.view', compute='_compute_view_ids')
bundle_ids = fields.One2many('runbot.bundle', 'dockerfile_id', string='Used in Bundles')
_sql_constraints = [('runbot_dockerfile_name_unique', 'unique(name)', 'A Dockerfile with this name already exists')]

View File

@ -32,6 +32,14 @@
</tree>
</field>
</page>
<page string="Bundles">
<field name="bundle_ids" widget="one2many">
<tree>
<field name="project_id"/>
<field name="name"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
@ -51,6 +59,7 @@
<field name="image_tag"/>
<field name="to_build"/>
<field name="version_ids" widget="many2many_tags"/>
<field name="bundle_ids"/>
<field name="dockerfile" invisible="True"/>
</tree>
</field>