[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
This commit is contained in:
parent
066e41b63d
commit
8880edd4fb
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue