[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:
Xavier Morel 2025-02-18 11:41:03 +01:00
parent b765bb8446
commit e19a9fad8f

View File

@ -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