Skip to Content
Menu
This question has been flagged
1 Reply
2958 Views

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
Discard
Best Answer

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
Discard
Author

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

Related Posts Replies Views Activity
2
Nov 16
4883
1
Oct 23
915
1
Mar 15
2650
3
Sep 24
9995
2
Feb 24
605