changes
This commit is contained in:
@@ -467,6 +467,40 @@ class RcConfig(models.Model):
|
||||
'info',
|
||||
)
|
||||
|
||||
def action_import_historical_faxes(self):
|
||||
"""Trigger historical fax import in the background via cron."""
|
||||
self.ensure_one()
|
||||
self._ensure_token()
|
||||
|
||||
cron = self.env.ref(
|
||||
'fusion_ringcentral.cron_rc_historical_fax_import',
|
||||
raise_if_not_found=False,
|
||||
)
|
||||
if cron:
|
||||
cron.sudo().write({
|
||||
'active': True,
|
||||
'nextcall': fields.Datetime.now(),
|
||||
})
|
||||
else:
|
||||
self.env['ir.cron'].sudo().create({
|
||||
'name': 'RingCentral: Historical Fax Import',
|
||||
'cron_name': 'RingCentral: Historical Fax Import',
|
||||
'model_id': self.env['ir.model']._get('fusion.fax').id,
|
||||
'state': 'code',
|
||||
'code': 'model._run_historical_fax_import()',
|
||||
'interval_number': 9999,
|
||||
'interval_type': 'days',
|
||||
'nextcall': fields.Datetime.now(),
|
||||
'active': True,
|
||||
})
|
||||
|
||||
return self._notify(
|
||||
'Fax Import Started',
|
||||
'Historical fax import (12 months) is running in the background. '
|
||||
'Check Fusion Connect > Faxes in a few minutes.',
|
||||
'info',
|
||||
)
|
||||
|
||||
def action_backfill_voicemail_media(self):
|
||||
"""Re-download audio and transcriptions for voicemails missing them."""
|
||||
self.ensure_one()
|
||||
|
||||
Reference in New Issue
Block a user