[FIX] ir.config.parameter: error in new API conversion
The conversion at eb04aa1e39
failed when `force=True`.
This commit is contained in:
@@ -41,10 +41,10 @@ class IrConfigParameter(models.Model):
|
||||
"""
|
||||
for key, func in _default_parameters.iteritems():
|
||||
# force=True skips search and always performs the 'if' body (because ids=False)
|
||||
self = not force and self.sudo().search([('key', '=', key)])
|
||||
if not self.ids:
|
||||
params = self.sudo().search([('key', '=', key)])
|
||||
if force or not params:
|
||||
value, groups = func()
|
||||
self.sudo().set_param(key, value, groups=groups)
|
||||
params.set_param(key, value, groups=groups)
|
||||
|
||||
@api.model
|
||||
def get_param(self, key, default=False):
|
||||
|
||||
Reference in New Issue
Block a user