talonario.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. from openerp import models, fields, tools, api, _
  22. class Talonario(models.Model):
  23. _name = 'talonario'
  24. _description = 'Talonario'
  25. name = fields.Char(string='Número de timbrado')
  26. nombre_documento = fields.Char(string='Descripción del documento')
  27. tipo_documento = fields.Selection([
  28. ('1', 'Factura'),
  29. ('2', 'Factura electrónica de exportación'),
  30. ('3', 'Factura electrónica de importación')
  31. ], 'Tipo documento')
  32. timbrado_electronico = fields.Selection([
  33. ('1', 'Factura electrónica'),
  34. ('2', 'Factura electrónica de exportación'),
  35. ('3', 'Factura electrónica de importación'),
  36. ('4', 'Autofactura electrónica'),
  37. ('5', 'Nota de crédito electrónica'),
  38. ('6', 'Nota de débito electrónica'),
  39. ('7', 'Nota de remisión electrónica'),
  40. ('8', 'Comprobante de retención electrónico')
  41. ], 'Tipo de documento electrónico')
  42. actividad_economica = fields.Char(string='Actividad económica')
  43. codigo_actividad = fields.Char(string='Código de actividad económica')
  44. fecha_inicio = fields.Date(string='Fecha inicio de validez')
  45. fecha_final = fields.Date(string='Fecha de expiración de timbrado')
  46. activo = fields.Boolean(string='Activo', default=True)
  47. suc = fields.Char(string='Suc')
  48. sec = fields.Char(string='Sec')
  49. nro_ini = fields.Integer(string='Nº inicial')
  50. nro_fin = fields.Integer(string='Nº final')
  51. ultimo_nro_utilizado = fields.Integer(string='Nro actual')
  52. company_id = fields.Many2one('res.company', 'Compañia')
  53. company_name = fields.Char(string='Compañia', related='company_id.name', readonly=True)
  54. invoice_ids = fields.One2many('account.invoice', 'talonario_id', 'Facturas', readonly=True, copy=False)
  55. user_ids = fields.Many2many('res.users', 'talonario_res_users_rel', 'talonario_id', 'user_id', 'Usuarios')