account_invoice.py 565 B

123456789101112131415161718192021222324
  1. # -*- encoding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class account_invoice(models.Model):
  4. _inherit = 'account.invoice'
  5. _name = 'account.invoice'
  6. contado = fields.Boolean('Contado')
  7. credito = fields.Boolean('Crédito')
  8. _defaults = {
  9. 'contado': True
  10. }
  11. @api.one
  12. @api.onchange('credito')
  13. def cambiar_estado_credito(self):
  14. self.contado = not self.credito
  15. @api.one
  16. @api.onchange('contado')
  17. def cambiar_estado_contado(self):
  18. self.credito = not self.contado