account_invoice.py 396 B

123456789101112
  1. from openerp import models,api,fields
  2. class AccountInvoiceLine(models.Model):
  3. _inherit = 'account.invoice.line'
  4. _name = 'account.invoice.line'
  5. @api.one
  6. @api.depends('product_id')
  7. def _get_factory_ref(self):
  8. self.product_factory_ref = self.product_id.factory_reference
  9. product_factory_ref = fields.Char(string="Referencia de Fabrica", compute="_get_factory_ref")