mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +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',
|
'runbot_merge.batch', 'staging_id',
|
||||||
context={'active_test': False},
|
context={'active_test': False},
|
||||||
)
|
)
|
||||||
|
pr_ids = fields.One2many('runbot_merge.pull_requests', compute='_compute_prs')
|
||||||
state = fields.Selection([
|
state = fields.Selection([
|
||||||
('success', 'Success'),
|
('success', 'Success'),
|
||||||
('failure', 'Failure'),
|
('failure', 'Failure'),
|
||||||
@ -1859,6 +1860,11 @@ class Stagings(models.Model):
|
|||||||
+ datetime.timedelta(minutes=st.target.project_id.ci_timeout)
|
+ 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):
|
def _validate(self):
|
||||||
Commits = self.env['runbot_merge.commit']
|
Commits = self.env['runbot_merge.commit']
|
||||||
for s in self:
|
for s in self:
|
||||||
|
@ -197,11 +197,19 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
<group string="Batches">
|
<group string="PRs">
|
||||||
<field name="batch_ids" colspan="4" nolabel="1">
|
<field name="pr_ids" colspan="4" nolabel="1" readonly="1">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="prs" widget="many2many_tags"
|
<field name="display_name"/>
|
||||||
options="{'no_quick_create': True}"/>
|
<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>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
Loading…
Reference in New Issue
Block a user