[FIX] loading: pool.get("ir.module.module") was done before it was available.
authorVo Minh Thu <vmt@openerp.com>
Mon, 11 Jul 2011 14:10:45 +0000 (16:10 +0200)
committerVo Minh Thu <vmt@openerp.com>
Mon, 11 Jul 2011 14:10:45 +0000 (16:10 +0200)
bzr revid: vmt@openerp.com-20110711141045-c3pyqe0zuwxlljip

openerp/modules/loading.py

index 5fc849d..fa17ced 100644 (file)
@@ -156,7 +156,6 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
     pool = pooler.get_pool(cr.dbname)
     migrations = openerp.modules.migration.MigrationManager(cr, graph)
     logger.notifyChannel('init', netsvc.LOG_DEBUG, 'loading %d packages..' % len(graph))
-    modobj = pool.get('ir.module.module')
 
     # register, instantiate and initialize models for each modules
     for package in graph:
@@ -175,6 +174,10 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
 
         status['progress'] = float(statusi) / len(graph)
 
+        # Can't put this line out of the loop: ir.module.module will be
+        # registered by init_module_models() above.
+        modobj = pool.get('ir.module.module')
+
         if perform_checks:
             modobj.check(cr, 1, [module_id])