Use global section name as first part of the section

This commit is contained in:
Guewen Baconnier 2018-07-19 22:18:31 +02:00 committed by Stéphane Bidoul (ACSONE)
parent 27c1a41f24
commit d7f0a1b24b
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 3 additions and 5 deletions

View File

@ -89,13 +89,12 @@ class ServerEnvMixin(models.AbstractModel):
""" """
return {} return {}
@api.multi @api.model
def _server_env_global_section_name(self): def _server_env_global_section_name(self):
"""Name of the global section in the configuration files """Name of the global section in the configuration files
Can be customized in your model Can be customized in your model
""" """
self.ensure_one()
return self._name.replace(".", "_") return self._name.replace(".", "_")
@api.multi @api.multi
@ -105,9 +104,8 @@ class ServerEnvMixin(models.AbstractModel):
Can be customized in your model Can be customized in your model
""" """
self.ensure_one() self.ensure_one()
return ".".join( base = self._server_env_global_section_name()
(self._name.replace(".", "_"), self.name) return ".".join((base, self.name))
)
@api.multi @api.multi
def _server_env_read_from_config(self, field_name, config_getter): def _server_env_read_from_config(self, field_name, config_getter):