runbot/forwardport/models/project_freeze.py
Xavier Morel b86092de83 [IMP] *: freeze wizard v3, freezer and wizarder
Stop *staging* release PRs: they are normally fairly simple and should
not fail their staging outside of unreliable tests (or possibly a few
edge cases e.g. forgot one version change thing), however staging them
creates the possibility of a "version hole" on the release branch
which is undesirable.

Instead, immediately and unconditionally push the release commits onto
the newly created branches, if there are things which don't work they
can be fixed afterwards (and the process refined, maybe).

Also add the same feature for *bump* PRs, with the difference that the
bump PRs are not created / requested by default (they have to be opted
in individually).

For convenience, add a feature which automatically finds the PRs via
inputting the label (not really tested yet).

Closes #603
2022-08-05 15:35:51 +02:00

23 lines
667 B
Python

from odoo import models
class FreezeWizard(models.Model):
""" Override freeze wizard to disable the forward port cron when one is
created (so there's a freeze ongoing) and re-enable it once all freezes are
done.
If there ever is a case where we have lots of projects,
"""
_inherit = 'runbot_merge.project.freeze'
def create(self, vals_list):
r = super().create(vals_list)
self.env.ref('forwardport.port_forward').active = False
return r
def unlink(self):
r = super().unlink()
if not self.search_count([]):
self.env.ref('forwardport.port_forward').active = True
return r