__init__.py 608 B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import models
  4. from . import controllers
  5. from . import report
  6. from . import wizard
  7. from . import populate
  8. from odoo.api import Environment, SUPERUSER_ID
  9. def _synchronize_cron(cr, registry):
  10. env = Environment(cr, SUPERUSER_ID, {'active_test': False})
  11. send_invoice_cron = env.ref('sale.send_invoice_cron', raise_if_not_found=False)
  12. if send_invoice_cron:
  13. config = env['ir.config_parameter'].get_param('sale.automatic_invoice', False)
  14. send_invoice_cron.active = bool(config)