You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

  1. # -*- coding: utf-8 -*-
  2. #
  3. # © 2004-2010 Tiny SPRL http://tiny.be
  4. # © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH
  5. # http://www.camptocamp.at
  6. # © 2015 Antiun Ingenieria, SL (Madrid, Spain)
  7. # http://www.antiun.com
  8. # Antonio Espinosa <antonioea@antiun.com>
  9. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  10. from openerp import api, models, fields
  11. class ResPartnerIdNumber(models.Model):
  12. _name = "res.partner.id_number"
  13. _order = "name"
  14. @api.constrains('name')
  15. def validate_id_number(self):
  16. self.category_id.validate_id_number(self)
  17. name = fields.Char(string="ID Number", required=True)
  18. category_id = fields.Many2one(string="Category", required=True,
  19. comodel_name='res.partner.id_category')
  20. partner_id = fields.Many2one(string="Partner", required=True,
  21. comodel_name='res.partner')
  22. partner_issued_id = fields.Many2one(string="Issued by",
  23. comodel_name='res.partner')
  24. date_issued = fields.Date(string="Issued on")
  25. valid_from = fields.Date(string="Valid from")
  26. valid_until = fields.Date(string="Valid until")
  27. comment = fields.Text(string="Notes")
  28. state = fields.Char(string="State", size=16)
  29. active = fields.Boolean(string="Active", default=True)