From ad97722b1b35aff50d0adf13a19715f7b8373c07 Mon Sep 17 00:00:00 2001 From: Richard Sassine Date: Tue, 4 May 2021 18:00:38 +0300 Subject: initial commit --- network/models/device.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 network/models/device.py (limited to 'network/models/device.py') diff --git a/network/models/device.py b/network/models/device.py new file mode 100644 index 0000000..328509a --- /dev/null +++ b/network/models/device.py @@ -0,0 +1,18 @@ +# -*- 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') -- cgit v1.2.3