mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[REM] forwardport: re-enablement of forward ports when closing wizard
This can yield odd effects when playing around e.g. opening freeze wizards then cancelling them. There is a check that there are no wizards left, but if a freeze is performed then an other is created and cancelled it will immediately re-enable forward ports, unexpectedly.
This commit is contained in:
parent
b765bb8446
commit
e19a9fad8f
@ -14,15 +14,3 @@ class FreezeWizard(models.Model):
|
||||
r = super().create(vals_list)
|
||||
self.env.ref('forwardport.port_forward').active = False
|
||||
return r
|
||||
|
||||
def action_freeze(self):
|
||||
return super(FreezeWizard, self.with_context(forwardport_keep_disabled=True))\
|
||||
.action_freeze()
|
||||
|
||||
def unlink(self):
|
||||
r = super().unlink()
|
||||
if not (self.env.context.get('forwardport_keep_disabled') or self.search_count([])):
|
||||
cron = self.env.ref('forwardport.port_forward')
|
||||
cron.active = True
|
||||
cron._trigger() # process forward ports enqueued during the freeze period
|
||||
return r
|
||||
|
Loading…
Reference in New Issue
Block a user