[IMP] runbot_merge: a few backend screens

- override the staging's name_get to provide a slightly more useful
  display_name (though still not great as the staging object remains
  quite technical and inimical to human interaction)
- show individual PRs in a batch (as m2m tags) for readability
- update PR views to show the author and reviewer, except in the list
  of delegations of users where it's a lot less useful

/cc #632
This commit is contained in:
Xavier Morel 2022-07-29 13:43:40 +02:00
parent 0c882fc0df
commit c3b90454a2
3 changed files with 23 additions and 2 deletions

View File

@ -1683,6 +1683,17 @@ class Stagings(models.Model):
statuses = fields.Binary(compute='_compute_statuses')
def name_get(self):
return [
(staging.id, "%d (%s, %s%s)" % (
staging.id,
staging.target.name,
staging.state,
(', ' + staging.reason) if staging.reason else '',
))
for staging in self
]
@api.depends('heads')
def _compute_statuses(self):
""" Fetches statuses associated with the various heads, returned as

View File

@ -77,6 +77,8 @@
<field name="number"/>
<field name="target"/>
<field name="state"/>
<field name="author"/>
<field name="reviewed_by"/>
</tree>
</field>
</record>
@ -198,7 +200,8 @@
<group string="Batches">
<field name="batch_ids" colspan="4" nolabel="1">
<tree>
<field name="prs"/>
<field name="prs" widget="many2many_tags"
options="{'no_quick_create': True}"/>
</tree>
</field>
</group>

View File

@ -70,7 +70,14 @@
</group>
<group>
<group colspan="4" string="Delegate On">
<field name="delegate_reviewer" nolabel="1"/>
<field name="delegate_reviewer" nolabel="1">
<tree>
<field name="repository"/>
<field name="number"/>
<field name="target"/>
<field name="state"/>
</tree>
</field>
</group>
</group>
</page>