跳至内容
菜单
此问题已终结
2 回复
8969 查看

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]
形象
丢弃