[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:
parent
853e354b55
commit
71de92dc44
|
@ -745,10 +745,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
|
||||||
finally:
|
finally:
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
if not status:
|
if status is None:
|
||||||
status = {}
|
status = {}
|
||||||
|
|
||||||
status = status.copy()
|
|
||||||
processed_modules = []
|
processed_modules = []
|
||||||
statusi = 0
|
statusi = 0
|
||||||
pool = pooler.get_pool(cr.dbname)
|
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))
|
logging.getLogger('init').warning('invalid module names, ignored: %s', ", ".join(incorrect_names))
|
||||||
|
|
||||||
def load_modules(db, force_demo=False, status=None, update_module=False):
|
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()
|
initialize_sys_path()
|
||||||
|
|
||||||
open_openerp_namespace()
|
open_openerp_namespace()
|
||||||
|
|
||||||
if not status:
|
|
||||||
status = {}
|
|
||||||
cr = db.cursor()
|
cr = db.cursor()
|
||||||
if cr:
|
if cr:
|
||||||
cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'")
|
cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'")
|
||||||
|
|
|
@ -27,8 +27,6 @@ pool_dic = {}
|
||||||
|
|
||||||
def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, pooljobs=True):
|
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."""
|
"""Return a database connection and an initialized osv_pool."""
|
||||||
if not status:
|
|
||||||
status={}
|
|
||||||
|
|
||||||
db = sql_db.db_connect(db_name)
|
db = sql_db.db_connect(db_name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue