From 30a9060bd958a330b76f2acd45ee9c001058a77b Mon Sep 17 00:00:00 2001 From: "HMO(OpenERP)" <> Date: Thu, 9 Jul 2009 13:22:59 +0530 Subject: [PATCH] [FIX] module installation through -i module -d db --without-demo option corrected bzr revid: jvo@tinyerp.com-20090709075259-sczetl8r88sovg25 --- bin/addons/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index d2b33ce7a4d..11503306743 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -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')