Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
8951 Visualizzazioni

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.

Avatar
Abbandona
Risposta migliore

My solution in slightly different situation:

self.env['ir.translation'].get_field_string(self._name)['field_name']
Avatar
Abbandona
Autore Risposta migliore

I found a solution:

self.env['ir.translation'].get_field_string(record.ref_class)[record.ref_field]
Avatar
Abbandona