__init__.py 635 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import api, fields, SUPERUSER_ID
  4. from . import models
  5. from . import wizard
  6. from . import populate
  7. def _install_hr_localization(cr, registry):
  8. env = api.Environment(cr, SUPERUSER_ID, {})
  9. if any(c.partner_id.country_id.code == 'MX' for c in env['res.company'].search([])):
  10. l10n_mx = env['ir.module.module'].sudo().search([
  11. ('name', '=', 'l10n_mx_hr'),
  12. ('state', 'not in', ['installed', 'to install', 'to upgrade']),
  13. ])
  14. if l10n_mx:
  15. l10n_mx.button_install()