From cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Sun, 6 Jul 2014 16:44:26 +0200 Subject: [MERGE] new v8 api by rco A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes --- openerp/modules/loading.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'openerp/modules/loading.py') diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index d81461d6a77..eb703e25eb6 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -162,6 +162,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= loaded_modules.append(package.name) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): + registry.setup_models(cr) init_module_models(cr, package.name, models) status['progress'] = float(index) / len(graph) @@ -188,6 +189,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= status['progress'] = (index + 0.75) / len(graph) _load_data(cr, module_name, idref, mode, kind='demo') cr.execute('update ir_module_module set demo=%s where id=%s', (True, module_id)) + modobj.invalidate_cache(cr, SUPERUSER_ID, ['demo'], [module_id]) migrations.migrate_module(package, 'post') @@ -228,6 +230,8 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= registry._init_modules.add(package.name) cr.commit() + registry.setup_models(cr) + _logger.log(25, "%s modules loaded in %.2fs, %s queries", len(graph), time.time() - t0, openerp.sql_db.sql_counter - t0_sql) # The query won't be valid for models created later (i.e. custom model @@ -332,6 +336,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False): modobj.button_upgrade(cr, SUPERUSER_ID, ids) cr.execute("update ir_module_module set state=%s where name=%s", ('installed', 'base')) + modobj.invalidate_cache(cr, SUPERUSER_ID, ['state']) # STEP 3: Load marked modules (skipping base which was done in STEP 1) -- cgit v1.2.3