تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
8939 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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]
الصورة الرمزية
إهمال