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.0 KiB

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