# -*- coding: utf-8 -*-
from . import controllers
from . import models

from odoo import api, SUPERUSER_ID


def pre_install_mail_calendar(cr, registry):
    env = api.Environment(cr, SUPERUSER_ID, {})
    module_mail = env['ir.module.module'].search([('name', '=', 'mail')])
    if(module_mail.state == 'uninstalled'):
        module_mail.sudo().button_install()
    module_calendar = env['ir.module.module'].search([('name', '=', 'calendar')])
    if (module_calendar.state == 'uninstalled'):
        module_calendar.sudo().button_install()
    module_note = env['ir.module.module'].search([('name', '=', 'note')])
    if (module_note.state == 'uninstalled'):
        module_note.sudo().button_install()