sale_order_ean13.py 337 B

123456789101112
  1. from openerp import models,api,fields
  2. class SaleOrderLine(models.Model):
  3. _inherit = 'sale.order.line'
  4. _name = 'sale.order.line'
  5. ean13 = fields.Char(string="Codigo de Barras", compute="_get_ean13")
  6. @api.one
  7. @api.depends('product_id')
  8. def _get_ean13(self):
  9. self.ean13 = self.product_id.ean13