# -*- coding: utf-8 -*- from odoo import models, fields, api class DeviceType(models.Model): _name = 'networking.device.type' name = fields.Char('Type') class Device(models.Model): _name = 'networking.device' name = fields.Char('IP Address', size=15) owner = fields.Many2one('res.partner', 'Owner') _type = fields.Many2one('networking.device.type', 'Type') parent_id = fields.Many2one('networking.device', 'Source') _parent_store = True parent_path = fields.Char(index=True) child_ids = fields.One2many('networking.device', 'parent_id', 'Child Devices')