summaryrefslogtreecommitdiff
path: root/odoo/cli
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/cli')
-rw-r--r--odoo/cli/start.py3
1 files changed, 3 insertions, 0 deletions
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