mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[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:
parent
780e20bfd6
commit
a692163f6e
@ -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:
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user