Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7314 มุมมอง

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
2637
0
ก.ค. 24
1978
1
พ.ย. 20
4255
1
ต.ค. 20
4871
1
ก.พ. 17
4089