From 3e0b720e510cfad29748a36f66dcef204e8256f0 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Wed, 19 Apr 2017 09:11:18 +0100 Subject: [PATCH] [IMP] cli: extract the project's path from active virtualenv (closes: #16512) The start command takes the default dbname from the path. But when running inside a virtualenv, it is a better default to take the dbname from the virtualenv's path. --- odoo/cli/start.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/odoo/cli/start.py b/odoo/cli/start.py index 043c411ad8d..bf15776295b 100644 --- a/odoo/cli/start.py +++ b/odoo/cli/start.py @@ -35,6 +35,9 @@ class Start(Command): args, unknown = parser.parse_known_args(args=cmdargs) + # When in a virtualenv, by default use it's path rather than the cwd + if args.path == '.' and os.environ.get('VIRTUAL_ENV'): + args.path = os.environ.get('VIRTUAL_ENV') project_path = os.path.abspath(os.path.expanduser(os.path.expandvars(args.path))) module_root = get_module_root(project_path) db_name = None