20 lines
748 B
Python
20 lines
748 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class QualityPoint(models.Model):
|
|
_inherit = "quality.point"
|
|
|
|
device_id = fields.Many2one('iot.device', ondelete='restrict', domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", index='btree_not_null')
|
|
|
|
|
|
class QualityCheck(models.Model):
|
|
_inherit = "quality.check"
|
|
|
|
ip = fields.Char(related='point_id.device_id.iot_id.ip')
|
|
identifier = fields.Char(related='point_id.device_id.identifier')
|
|
iot_box_id = fields.Many2one(related='point_id.device_id.iot_id', store=False)
|
|
device_name = fields.Char(related='point_id.device_id.name', size=30, string='Device Name: ')
|