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.

50 lines
2.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # Python source code encoding : https://www.python.org/dev/peps/pep-0263/
  3. ##############################################################################
  4. #
  5. # OpenERP, Open Source Management Solution
  6. # This module copyright :
  7. # (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com)
  8. # Antonio Espinosa <antonioea@antiun.com>
  9. #
  10. # This program is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU Affero General Public License as
  12. # published by the Free Software Foundation, either version 3 of the
  13. # License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU Affero General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Affero General Public License
  21. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. #
  23. ##############################################################################
  24. from openerp import models, fields
  25. class ResPartnerNace(models.Model):
  26. _name = 'res.partner.nace'
  27. _order = "parent_left"
  28. _parent_order = "name"
  29. _parent_store = True
  30. _description = "NACE Activity"
  31. # NACE fields
  32. level = fields.Integer(required=True)
  33. code = fields.Char(required=True)
  34. name = fields.Char(required=True, translate=True)
  35. generic = fields.Char(string="ISIC Rev.4")
  36. rules = fields.Text()
  37. central_content = fields.Text(translate=True, string="Contents")
  38. limit_content = fields.Text(translate=True, string="Also contents")
  39. exclusions = fields.Char(string="Excludes")
  40. # Parent hierarchy
  41. parent_id = fields.Many2one(comodel_name='res.partner.nace',
  42. ondelete='restrict')
  43. children = fields.One2many(comodel_name='res.partner.nace',
  44. inverse_name='parent_id')
  45. parent_left = fields.Integer('Parent Left', select=True)
  46. parent_right = fields.Integer('Parent Right', select=True)