From ecfaf213c470925caffb94ca3a0263595c79e87d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 29 Jul 2015 12:15:47 +0200 Subject: [PATCH] [FIX] module loading: pre/post_init_hook execution New installation was detected using the `installed_version` attribute (`latest_version` in `ir_module_module` table), but this field wasn't reset at module uninstallation (now fixed by cb29f9e) avoiding execution of hooks. Same logic was applied for migration scripts at 8ff7230. Fixes #7708 --- openerp/modules/loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 7015c134a87..3d0ade8aa3e 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -142,7 +142,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= migrations.migrate_module(package, 'pre') load_openerp_module(package.name) - new_install = package.installed_version is None + new_install = package.state == 'to install' if new_install: py_module = sys.modules['openerp.addons.%s' % (module_name,)] pre_init = package.info.get('pre_init_hook')