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
parent 6b44590605
commit 9ae51f3c68
1 changed files with 3 additions and 5 deletions

View File

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