__init__.py 545 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from . import models
  4. from odoo import api, SUPERUSER_ID
  5. def post_init_hook(cr, registry):
  6. env = api.Environment(cr, SUPERUSER_ID, {})
  7. email = env['ir.config_parameter'].get_param('hr_presence.hr_presence_control_email')
  8. ip = env['ir.config_parameter'].get_param('hr_presence.hr_presence_control_ip')
  9. if not email and not ip:
  10. env['ir.config_parameter'].sudo().set_param('hr_presence.hr_presence_control_email', True)