diff options
Diffstat (limited to 'network/models/device.py')
| -rw-r--r-- | network/models/device.py | 18 |
1 files changed, 18 insertions, 0 deletions
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') |
