From 8880edd4fb6fd8721facdc3962eb6552709b3375 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Mon, 23 Mar 2015 15:13:48 +0000 Subject: [PATCH] [FIX] cli: start command path option does not work Using the `start` CLI command with the `--path` or `-p` option arrors with: odoo.py: error: no such option: --path This is because the `--path` option is passed on the server start routine, and it's invalid there. A workaround is to remove those command options from the arguments passed to the main() server start. Closes #5896 --- openerp/cli/start.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openerp/cli/start.py b/openerp/cli/start.py index d23bca8b8d5..b0cc932e19d 100644 --- a/openerp/cli/start.py +++ b/openerp/cli/start.py @@ -61,6 +61,13 @@ class Start(Command): if '--db-filter' not in cmdargs: cmdargs.append('--db-filter=^%s$' % args.db_name) + # Remove --path /-p options from the command arguments + def to_remove(i, l): + return l[i] == '-p' or l[i].startswith('--path') or \ + (i > 0 and l[i-1] in ['-p', '--path']) + cmdargs = [v for i, v in enumerate(cmdargs) + if not to_remove(i, cmdargs)] + main(cmdargs) def die(message, code=1):