from openerp import models,api,fields class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' _name = 'purchase.order.line' ean13 = fields.Char(string="Codigo de Barras", compute="_get_ean13") @api.one @api.depends('product_id') def _get_ean13(self): self.ean13 = self.product_id.ean13