[FIX] module installation through -i module -d db --without-demo option corrected

bzr revid: jvo@tinyerp.com-20090709075259-sczetl8r88sovg25
This commit is contained in:
HMO(OpenERP)
2009-07-09 13:22:59 +05:30
committed by Jay (Open ERP)
parent a472c61d6e
commit 30a9060bd9
+11
View File
@@ -663,6 +663,17 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
status = {}
cr = db.cursor()
if cr:
cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'")
if len(cr.fetchall())==0:
logger.notifyChannel("init", netsvc.LOG_INFO, "init db")
tools.init_db(cr)
# cr.execute("update res_users set password=%s where id=%s",('admin',1))
# in that case, force --init=all
tools.config["init"]["all"] = 1
tools.config['update']['all'] = 1
if not tools.config['without_demo']:
tools.config["demo"]['all'] = 1
force = []
if force_demo:
force.append('demo')