diff options
| author | Richard Sassine <richardsassine@tutanota.com> | 2021-05-04 18:00:38 +0300 |
|---|---|---|
| committer | Richard Sassine <richardsassine@tutanota.com> | 2021-05-04 18:00:38 +0300 |
| commit | ad97722b1b35aff50d0adf13a19715f7b8373c07 (patch) | |
| tree | edf36f1114b896a01602e31dafd74efe45736427 /network/models/device.py | |
initial commit
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') |
