跳至内容
菜单
此问题已终结

On my sale.line, I've added a Many2one-field, referencing to an other (custom) model.
My goal is to get the field in orderlines translated.


Custom model

class Color(models.Model):
_name = 'color.color'
_description = 'Color'
_rec_name = 'name'

code = fields.Char('Code')
name = fields.Char('Color', translate=True)

Added field in an inherited sale_line.py

color_id = fields.Many2one('color.color', string='Color')

Inherited view of sale.view_order_form

<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="after">
<field name="color_id" context="{'lang': 'de_DE'}"/>
xpath>

My issue

The dropdown is shown in user's language, and not in de_DE

(I really want to relate the context to partner's language, but that's no problem when this issue is solved).


I've also tried the following, but this didn't seem to work either.

color_id = fields.Many2one('color.color', context="{'lang': 'de_DE'}")




形象
丢弃
相关帖文 回复 查看 活动
2
3月 23
14968
0
1月 21
2225
2
8月 18
3784
0
3月 15
4974
3
5月 24
7227