Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1772 Представления

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




Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
мар. 23
14972
0
янв. 21
2227
2
авг. 18
3784
0
мар. 15
4977
3
мая 24
7229