mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: allow sorting & deactivating branches
Closes #144, closes #145
This commit is contained in:
parent
84ad4cefe0
commit
5e611f54cb
@ -32,6 +32,7 @@ class Project(models.Model):
|
||||
)
|
||||
branch_ids = fields.One2many(
|
||||
'runbot_merge.branch', 'project_id',
|
||||
context={'active_test': False},
|
||||
help="Branches of all project's repos which are managed by the merge bot. Also "\
|
||||
"target branches of PR this project handles."
|
||||
)
|
||||
@ -232,6 +233,7 @@ class Repository(models.Model):
|
||||
|
||||
class Branch(models.Model):
|
||||
_name = 'runbot_merge.branch'
|
||||
_order = 'sequence, name'
|
||||
|
||||
name = fields.Char(required=True)
|
||||
project_id = fields.Many2one('runbot_merge.project', required=True)
|
||||
@ -248,6 +250,9 @@ class Branch(models.Model):
|
||||
('state', '!=', 'merged'),
|
||||
])
|
||||
|
||||
active = fields.Boolean(default=True)
|
||||
sequence = fields.Integer()
|
||||
|
||||
def _auto_init(self):
|
||||
res = super(Branch, self)._auto_init()
|
||||
tools.create_unique_index(
|
||||
|
@ -42,8 +42,10 @@
|
||||
</field>
|
||||
<separator string="Branches"/>
|
||||
<field name="branch_ids">
|
||||
<tree editable="bottom">
|
||||
<tree editable="bottom" decoration-muted="not active">
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</sheet>
|
||||
|
@ -44,7 +44,7 @@
|
||||
<li class="bg-gray-lighter">cancelled</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section t-foreach="project.branch_ids" t-as="branch" class="col-md-12">
|
||||
<section t-foreach="project.branch_ids" t-as="branch" t-if="branch.active" class="col-md-12">
|
||||
<h2><t t-esc="branch.name"/></h2>
|
||||
<t t-call="runbot_merge.stagings"/>
|
||||
<t t-set="ready_unstaged" t-value="
|
||||
|
Loading…
Reference in New Issue
Block a user