Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
8915 Widoki

I have a python code where I want to translate a field name and a model name, which are stored in another record, to the display string for the current user language.

Awatar
Odrzuć
Najlepsza odpowiedź

My solution in slightly different situation:

self.env['ir.translation'].get_field_string(self._name)['field_name']
Awatar
Odrzuć
Autor Najlepsza odpowiedź

I found a solution:

self.env['ir.translation'].get_field_string(record.ref_class)[record.ref_field]
Awatar
Odrzuć