From 71de92dc44a89b7a7402c1f28d3a528fde3d24cf Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 10 May 2011 16:28:49 +0200 Subject: [PATCH] [FIX] db.get_progress was broken: - the status dictionary was ignored - it is still slightly broken (see added comment in openerp/modules/__init__.py) bzr revid: vmt@openerp.com-20110510142849-p9kcd60agybpm8bd --- openerp/modules/__init__.py | 8 ++++---- openerp/pooler.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openerp/modules/__init__.py b/openerp/modules/__init__.py index 45fc0ee3e80..aee0ceebf13 100644 --- a/openerp/modules/__init__.py +++ b/openerp/modules/__init__.py @@ -745,10 +745,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= finally: fp.close() - if not status: + if status is None: status = {} - status = status.copy() processed_modules = [] statusi = 0 pool = pooler.get_pool(cr.dbname) @@ -842,13 +841,14 @@ def _check_module_names(cr, module_names): logging.getLogger('init').warning('invalid module names, ignored: %s', ", ".join(incorrect_names)) def load_modules(db, force_demo=False, status=None, update_module=False): + # TODO status['progress'] reporting is broken: used twice (and reset each + # time to zero) in load_module_graph, not fine-grained enough. + # It should be a method exposed by the pool. initialize_sys_path() open_openerp_namespace() - if not status: - status = {} cr = db.cursor() if cr: cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'") diff --git a/openerp/pooler.py b/openerp/pooler.py index 84f0650b91d..fb47a948752 100644 --- a/openerp/pooler.py +++ b/openerp/pooler.py @@ -27,8 +27,6 @@ pool_dic = {} def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, pooljobs=True): """Return a database connection and an initialized osv_pool.""" - if not status: - status={} db = sql_db.db_connect(db_name)