[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
This commit is contained in:
Vo Minh Thu 2011-05-10 16:28:49 +02:00
parent 853e354b55
commit 71de92dc44
2 changed files with 4 additions and 6 deletions

View File

@ -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'")

View File

@ -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)