import logging from odoo.api import Environment, SUPERUSER_ID _logger = logging.getLogger(__name__) # def pre_init_hook(cr, registry): # env = Environment(cr, SUPERUSER_ID, {}) # _logger.info("Pre init hook") def post_init_hook(cr, registry): env = Environment(cr, SUPERUSER_ID, {}) env["res.country"].search( [ ( "code", "in", ( "FR", "GP", "MQ", "GF", "RE", "YT", ), ) ] ).write( { "is_french": True, } ) _logger.info("\n#####\nPost init hook for french associations passed...\n#####\n") # def uninstall_hook(cr, registry): # env = Environment(cr, SUPERUSER_ID, {}) # _logger.info("Uninstall hook")