From 6cc7c0321249817b061326f5fa2aba2774c79896 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Fri, 8 Jul 2016 08:47:23 +0200 Subject: [PATCH] [FIX] tools: use without_demo specified in configuration file When using the -i command line option without the --without-demo=all command line option, demo data was installed even if the configuration file has a line without_demo = all This change is safe as just above, opt.without_demo is copied into self.options['without_demo'] so we are sure to consider the 2 options. Closes #12730 Fixes #9293 --- openerp/tools/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 271499e4b52..fce5b9084f1 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -427,7 +427,8 @@ class configmanager(object): for x in self.options['addons_path'].split(',')) self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {} - self.options["demo"] = not opt.without_demo and self.options['init'] or {} + self.options['demo'] = (self.options['init'] + if not self.options['without_demo'] else {}) self.options['update'] = opt.update and dict.fromkeys(opt.update.split(','), 1) or {} self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all'] self.options['translate_modules'].sort()