コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
8963 ビュー

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]
アバター
破棄