summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorJulien Castiaux <juc@odoo.com>2020-08-11 09:58:30 +0000
committerJulien Castiaux <juc@odoo.com>2020-10-29 13:22:17 +0000
commit8b67d263ab04bbb2e6ccd6c4095029eadcc36138 (patch)
tree3372620131f1818c963521ae684dc9996f29ff5b /odoo
parenta6d01ac7f7717b2ffba0d6d88dfd6e2d2c6b86fd (diff)
[FIX] config: empty argument --foo= to disable
In the odoorc file, set a `logfile` path, but disable it via the command line with `--logfile=`. The logs are output to the logfile configured in the config file instead of stdout. Parsing `--logile=` yield an empty string which was interpreted as argument not set and skipped. Closes #3852 closes odoo/odoo#60990 X-original-commit: bae0d99b8d654283be4d265e3b40a83247a2299c Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/tools/config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index e703ee33ad9..f6e186f15ab 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -439,7 +439,7 @@ class configmanager(object):
for arg in keys:
# Copy the command-line argument (except the special case for log_handler, due to
# action=append requiring a real default, so we cannot use the my_default workaround)
- if getattr(opt, arg):
+ if getattr(opt, arg, None) is not None:
self.options[arg] = getattr(opt, arg)
# ... or keep, but cast, the config file value.
elif isinstance(self.options[arg], str) and self.casts[arg].type in optparse.Option.TYPE_CHECKER: