summaryrefslogtreecommitdiff
path: root/odoo/modules/loading.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/modules/loading.py')
-rw-r--r--odoo/modules/loading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py
index 515cd4763bb..50cbffa83ed 100644
--- a/odoo/modules/loading.py
+++ b/odoo/modules/loading.py
@@ -556,6 +556,10 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
_logger.error('At least one test failed when loading the modules.')
# STEP 8: call _register_hook on every model
+ # This is done *exactly once* when the registry is being loaded. See the
+ # management of those hooks in `Registry.setup_models`: all the calls to
+ # setup_models() done here do not mess up with hooks, as registry.ready
+ # is False.
env = api.Environment(cr, SUPERUSER_ID, {})
for model in env.values():
model._register_hook()