[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
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user