account_invoice.py 672 B

12345678910111213141516171819202122
  1. # -*- encoding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class AccountInvoice(models.Model):
  4. _name = 'account.invoice'
  5. _inherit = 'account.invoice'
  6. attachment_ids = fields.One2many('ir.attachment', 'res_id', 'Attachment')
  7. timbrado = fields.Char('Nº de timbrado del proveedor', size=8)
  8. contado = fields.Boolean('Contado')
  9. credito = fields.Boolean('Crédito')
  10. @api.one
  11. @api.onchange('credito')
  12. def cambiar_estado_credito(self):
  13. self.contado = not self.credito
  14. @api.one
  15. @api.onchange('contado')
  16. def cambiar_estado_contado(self):
  17. if self.contado == True:
  18. self.credito = not self.contado