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.

34 lines
1.0 KiB

  1. # Copyright 2014 Pedro M. Baeza <pedro.baeza@tecnativa.com>
  2. # Copyright 2015 Antonio Espinosa <antonioea@antiun.com>
  3. # Copyright 2015 Jairo Llopis <jairo.llopis@tecnativa.com>
  4. # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
  5. from odoo import fields, models
  6. class ResPartner(models.Model):
  7. _inherit = 'res.partner'
  8. job_position_id = fields.Many2one(
  9. "res.partner.job_position",
  10. "Categorized job position",)
  11. class ResPartnerJobPosition(models.Model):
  12. _name = "res.partner.job_position"
  13. _order = "parent_left"
  14. _parent_order = "name"
  15. _parent_store = True
  16. _description = "Job position"
  17. name = fields.Char(required=True, translate=True)
  18. parent_id = fields.Many2one(
  19. "res.partner.job_position",
  20. "Parent", ondelete='restrict')
  21. child_ids = fields.One2many(
  22. "res.partner.job_position",
  23. "parent_id",
  24. "Children",
  25. oldname="children")
  26. parent_left = fields.Integer(index=True)
  27. parent_right = fields.Integer(index=True)