__init__.py 478 B

123456789101112131415
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import models
  4. from odoo.api import Environment, SUPERUSER_ID
  5. def _synchronize_cron(cr, registry):
  6. env = Environment(cr, SUPERUSER_ID, {'active_test': False})
  7. cron = env.ref('crm_iap_enrich.ir_cron_lead_enrichment')
  8. if cron:
  9. config = env['ir.config_parameter'].get_param('crm.iap.lead.enrich.setting', 'auto')
  10. cron.active = config == 'auto'