Skip to Content
Menu
This question has been flagged

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'}")




Avatar
Discard
Related Posts Replies Views Activity
2
Mar 23
9973
0
Jan 21
1371
2
Aug 18
2824
0
Mar 15
3886
3
May 24
3956