|
|
@ -122,9 +122,11 @@ class CooperativeStatus(models.Model): |
|
|
|
##################################### |
|
|
|
# Status Change implementation # |
|
|
|
##################################### |
|
|
|
def _set_regular_status(self, grace_delay, alert_delay): |
|
|
|
def _get_regular_status(self): |
|
|
|
self.ensure_one() |
|
|
|
counter_unsubscribe = int(self.env['ir.config_parameter'].get_param('regular_counter_to_unsubscribe', -4)) |
|
|
|
counter_unsubscribe = int(self.env['ir.config_parameter'].sudo().get_param('regular_counter_to_unsubscribe', -4)) |
|
|
|
alert_delay = int(self.env['ir.config_parameter'].sudo().get_param('alert_delay', 28)) |
|
|
|
grace_delay = int(self.env['ir.config_parameter'].sudo().get_param('default_grace_delay', 10)) |
|
|
|
ok = self.sr >= 0 and self.sc >= 0 |
|
|
|
grace_delay = grace_delay + self.time_extension |
|
|
|
|
|
|
@ -156,9 +158,11 @@ class CooperativeStatus(models.Model): |
|
|
|
elif ok or (not self.alert_start_time and self.sr >= 0): |
|
|
|
return 'ok' |
|
|
|
|
|
|
|
def _set_irregular_status(self, grace_delay, alert_delay): |
|
|
|
counter_unsubscribe = int(self.env['ir.config_parameter'].get_param('irregular_counter_to_unsubscribe', -3)) |
|
|
|
def _get_irregular_status(self): |
|
|
|
self.ensure_one() |
|
|
|
counter_unsubscribe = int(self.env['ir.config_parameter'].sudo().get_param('irregular_counter_to_unsubscribe', -3)) |
|
|
|
alert_delay = int(self.env['ir.config_parameter'].sudo().get_param('alert_delay', 28)) |
|
|
|
grace_delay = int(self.env['ir.config_parameter'].sudo().get_param('default_grace_delay', 10)) |
|
|
|
ok = self.sr >= 0 |
|
|
|
grace_delay = grace_delay + self.time_extension |
|
|
|
if self.sr <= counter_unsubscribe or self.unsubscribed: |
|
|
|