[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
This commit is contained in:
Christophe Simonis 2015-07-29 12:15:47 +02:00
parent a2fe8e18d6
commit ecfaf213c4
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
migrations.migrate_module(package, 'pre')
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')