[IMP] runbot_merge: add quick jump from stagings to PRs

In the backend, the intermediate jump through batches is really not
convenient (even if we kinda have to jump through batches *anyway*).

Fixes #751
This commit is contained in:
Xavier Morel 2023-07-06 14:23:09 +02:00
parent 780e20bfd6
commit a692163f6e
2 changed files with 18 additions and 4 deletions

View File

@ -1758,6 +1758,7 @@ class Stagings(models.Model):
'runbot_merge.batch', 'staging_id',
context={'active_test': False},
)
pr_ids = fields.One2many('runbot_merge.pull_requests', compute='_compute_prs')
state = fields.Selection([
('success', 'Success'),
('failure', 'Failure'),
@ -1859,6 +1860,11 @@ class Stagings(models.Model):
+ datetime.timedelta(minutes=st.target.project_id.ci_timeout)
)
@api.depends('batch_ids.prs')
def _compute_prs(self):
for staging in self:
staging.pr_ids = staging.batch_ids.prs
def _validate(self):
Commits = self.env['runbot_merge.commit']
for s in self:

View File

@ -197,11 +197,19 @@
</tree>
</field>
</group>
<group string="Batches">
<field name="batch_ids" colspan="4" nolabel="1">
<group string="PRs">
<field name="pr_ids" colspan="4" nolabel="1" readonly="1">
<tree>
<field name="prs" widget="many2many_tags"
options="{'no_quick_create': True}"/>
<field name="display_name"/>
<field name="github_url" widget="url"/>
<field name="url" widget="url"/>
</tree>
</field>
</group>
<group string="Batches">
<field name="batch_ids" colspan="4" nolabel="1" readonly="1">
<tree>
<field name="prs" widget="many2many_tags"/>
</tree>
</field>
</group>