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.

24 lines
890 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Daniel Reis
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import models, fields
  5. class ResPartnerLAU(models.Model):
  6. _name = 'res.partner.lau'
  7. _order = "code"
  8. _parent_order = "name"
  9. _parent_store = True
  10. _description = "LAU Item"
  11. level = fields.Integer(required=True, index=True)
  12. code = fields.Char(required=True)
  13. name = fields.Char(required=True, translate=True)
  14. country_id = fields.Many2one('res.country', 'Country', required=True)
  15. state_id = fields.Many2one('res.country.state', 'State')
  16. # Parent hierarchy
  17. parent_id = fields.Many2one('res.partner.lau', ondelete='restrict')
  18. child_ids = fields.One2many('res.partner.lau', 'parent_id', 'Children')
  19. parent_left = fields.Integer('Parent Left', index=True)
  20. parent_right = fields.Integer('Parent Right', index=True)