Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7293 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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 ...

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Serpant,

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 22
2620
0
thg 7 24
1967
1
thg 11 20
4245
1
thg 10 20
4844
1
thg 2 17
4076