Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3845 Zobrazení

HI there,
I am trying to add a "vat " field to the Sales Order model so I will be able to display the vat number in tree view. "vat" field is currently present in Partner / Companies / Users. This is my py code:

from openerp import models, fields

class SaleOrderInherited(models.Model):
    _inherit = 'sale.order' 
    vat = fields.Char(string='vat', related='partner.vat')
Avatar
Zrušit
Nejlepší odpověď

Hi,

You have to give it like this,

from openerp import models, fields

class SaleOrderInherited(models.Model):
    _inherit = 'sale.order' 
vat = fields.Char(string='vat', related='partner_id.vat')


partner_id.vat not partner.vat


Thanks

Avatar
Zrušit
Autor

Thank you so much:) I don't know where I lost my logic thinking;)

Related Posts Odpovědi Zobrazení Aktivita
2
lis 16
6099
1
říj 23
1722
1
bře 15
3578
3
kvě 25
1699
1
dub 25
1272