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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
2
Réponses
8926
Vues
My solution in slightly different situation:
self.env['ir.translation'].get_field_string(self._name)['field_name']
I found a solution:
self.env['ir.translation'].get_field_string(record.ref_class)[record.ref_field]
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire