Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3814 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
2
nov 16
6040
1
oct 23
1706
1
mar 15
3556
3
may 25
1632
1
abr 25
1232