跳至内容
菜单
此问题已终结
3 回复
7229 查看

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

形象
丢弃
相关帖文 回复 查看 活动
0
5月 22
2526
0
7月 24
1944
1
11月 20
4130
1
10月 20
4740
1
2月 17
4036