Browse Source

[FIX] missing sudo in server_environment_ir_config_param

Without this sudo get_param would fail when the first user reading a parameter that has changed in the configuration file does not have write access to system parameters.
pull/937/head
Stéphane Bidoul (ACSONE) 7 years ago
parent
commit
d6b0995fed
No known key found for this signature in database GPG Key ID: 866D394B4986F82D
  1. 2
      server_environment_ir_config_parameter/__manifest__.py
  2. 2
      server_environment_ir_config_parameter/models/ir_config_parameter.py

2
server_environment_ir_config_parameter/__manifest__.py

@ -6,7 +6,7 @@
'name': 'Server Environment Ir Config Parameter',
'summary': """
Override System Parameters from server environment file""",
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://odoo-community.org/',

2
server_environment_ir_config_parameter/models/ir_config_parameter.py

@ -28,7 +28,7 @@ class IrConfigParameter(models.Model):
# should we have preloaded values in database at,
# server startup, modules loading their parameters
# from data files would break on unique key error.
self.set_param(key, cvalue)
self.sudo().set_param(key, cvalue)
value = cvalue
if value is None:
return default

Loading…
Cancel
Save