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.

38 lines
1.2 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
  3. # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
  4. # Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
  5. # Antonio Espinosa <antonioea@antiun.com>
  6. # © 2015 Antiun Ingeniería S.L. - Jairo Llopis
  7. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  8. from openerp import models, fields
  9. class ResPartner(models.Model):
  10. _inherit = 'res.partner'
  11. job_position_id = fields.Many2one(
  12. "res.partner.job_position",
  13. "Categorized job position",
  14. oldname="job_position")
  15. class ResPartnerJobPosition(models.Model):
  16. _name = "res.partner.job_position"
  17. _order = "parent_left"
  18. _parent_order = "name"
  19. _parent_store = True
  20. _description = "Job position"
  21. name = fields.Char(required=True, translate=True)
  22. parent_id = fields.Many2one(
  23. "res.partner.job_position",
  24. "Parent", ondelete='restrict')
  25. child_ids = fields.One2many(
  26. "res.partner.job_position",
  27. "parent_id",
  28. "Children",
  29. oldname="children")
  30. parent_left = fields.Integer(index=True)
  31. parent_right = fields.Integer(index=True)