Skip to content

Commit 75c8395

Browse files
committed
[IMP] server_environment: Add hook to find record name
This hook allows to customize how the record name is found from the server env config, what can be useful if we want to identify records in server environment through M2o fields (eg in case records have same name in different companies)
1 parent 4a3b946 commit 75c8395

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

server_environment/models/server_env_mixin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,16 @@ def _server_env_global_section_name(self):
188188

189189
_server_env_section_name_field = "name"
190190

191+
def _server_env_record_name(self):
192+
return self[self._server_env_section_name_field]
193+
191194
def _server_env_section_name(self):
192195
"""Name of the section in the configuration files
193196
194197
Can be customized in your model
195198
"""
196199
self.ensure_one()
197-
val = self[self._server_env_section_name_field]
200+
val = self._server_env_record_name()
198201
if not val:
199202
# special case: we have onchanges relying on tech_name
200203
# and we are testing them using `tests.common.Form`.

0 commit comments

Comments
 (0)