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

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
14586
0
1月 21
2167
2
8月 18
3688
0
3月 15
4867
3
5月 24
7066