Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
7251 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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.

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

Hi Serpant,

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mag 22
2585
0
lug 24
1954
1
nov 20
4160
1
ott 20
4773
1
feb 17
4046