From 8ea9ce1ed862c22dd037dbe5ac67997581e8ff6f Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Tue, 26 Apr 2022 12:51:44 +0000 Subject: [PATCH] [FIX] base: allow proper override of `config_parameter` Prior to this commit there was no way for a `res.config.settings` field using a `config_parameter` and remove the `config_parameter` aspect. After this commit, the parameter is ignored if it is falsy. TaskId-2825096 X-original-commit: b0b62ee3e302b1a1d08d1c8a32bf297380a4f27b Part-of: odoo/odoo#89806 --- odoo/addons/base/models/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_config.py b/odoo/addons/base/models/res_config.py index 7ba7a090b9d..97065bfa79c 100644 --- a/odoo/addons/base/models/res_config.py +++ b/odoo/addons/base/models/res_config.py @@ -474,7 +474,7 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin) if field.type not in ('boolean', 'selection'): raise Exception("Field %s must have type 'boolean' or 'selection'" % field) modules += IrModule._get(name[7:]) - elif hasattr(field, 'config_parameter'): + elif hasattr(field, 'config_parameter') and field.config_parameter: if field.type not in ('boolean', 'integer', 'float', 'char', 'selection', 'many2one', 'datetime'): raise Exception("Field %s must have type 'boolean', 'integer', 'float', 'char', 'selection', 'many2one' or 'datetime'" % field) configs.append((name, field.config_parameter))