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

How do I show the product default code in the "Product" column and product name in the "Description" column? 

http://i.imgur.com/pnoKtxI.png

Аватар
Отменить
Лучший ответ

Hello Odoo_fa,

You need to do the following:

1. Override the name_get() of product.product model. (So Product column will display code!)

2. Override the onchange trigger of product_id of the purchase.order.line model. (So Description column will display name!)

Hope this helps.

Thanks.

Аватар
Отменить
Лучший ответ

class puchase_order_line(models.Model):

_inherit='puchase.order.line'

default_code = fields.Char('Internal Reference',related='product_id.product_tmpl_id.default_code')


you add a related field in order line and so you can print or add in a tree view ...

Аватар
Отменить
Лучший ответ

Hi Serpant,

could you please expalin more I want to show the default_code in account_invoice instead of Product

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
мая 22
2552
0
июл. 24
1950
1
нояб. 20
4147
1
окт. 20
4762
1
февр. 17
4041