102 lines
3.1 KiB
Python
102 lines
3.1 KiB
Python
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
#txhis repository contains the full copyright notices and license terms
|
|
|
|
from trytond.pool import Pool, PoolMeta
|
|
from trytond.model import ModelView, ModelSQL, fields
|
|
from trytond.pyson import If, Eval
|
|
|
|
|
|
_RISK = [('uno', 'I'),
|
|
('dosA', 'IIA'),
|
|
('dosB', 'IIB')]
|
|
|
|
_USE = [('medico', 'Médico'),
|
|
('basico', 'Basico'),
|
|
('apoyo', 'Apoyo')]
|
|
|
|
_BIOMEDICAL_CLASS = [('diagnostico', 'Diagnóstico'),
|
|
('rehabilitación', 'Rehabilitación')]
|
|
|
|
_MAIN_TECNOLOGY = [('mecanico', 'Mecánico'),
|
|
('electrico', 'Electrico'),
|
|
('electronico', 'Electrónico'),
|
|
('hidraulico', 'Hidraulico'),
|
|
('neumatico', 'Neumatico')]
|
|
|
|
_EQUIPMENT_TYPE = [('mobiliario_optico', 'Mobiliario óptico'),
|
|
('refraccion', 'Refracción'),
|
|
('medico', 'Medicion'),
|
|
('accesorios', 'Accesorios')]
|
|
|
|
|
|
class Template(metaclass=PoolMeta):
|
|
'Template'
|
|
__name__ = 'product.template'
|
|
|
|
equipment = fields.Boolean('It is equipment')
|
|
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type')
|
|
risk = fields.Selection(_RISK, 'Type risk')
|
|
use = fields.Selection(_USE, 'Use')
|
|
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS,
|
|
'Biomedical Class')
|
|
main_tecnology = fields.Selection(_MAIN_TECNOLOGY,
|
|
'Main tecnology')
|
|
calibration = fields.Boolean("Apply calibration")
|
|
observation = fields.Text('Observation')
|
|
mark_category = fields.Many2One('product.category', 'Mark')
|
|
model_category = fields.Many2One('product.category', "Model")
|
|
reference = fields.Char("Reference", size=None)
|
|
origin_country = fields.Many2One('country.country',"Origin Country")
|
|
software_version = fields.Char(
|
|
"Software version", size=None)
|
|
useful_life = fields.Char(
|
|
"Useful life", size=None)
|
|
warranty = fields.Char(
|
|
"Warranty", size=None)
|
|
serial = fields.Char(
|
|
"Serial", size=None)
|
|
health_register = fields.Char(
|
|
"Health_Register", size=None)
|
|
refurbish = fields.Boolean('Refurbish')
|
|
|
|
@staticmethod
|
|
def default_equipment():
|
|
return False
|
|
|
|
@staticmethod
|
|
def default_risk():
|
|
return None
|
|
|
|
@staticmethod
|
|
def default_use():
|
|
return None
|
|
|
|
@staticmethod
|
|
def default_biomedical_class():
|
|
return None
|
|
|
|
@staticmethod
|
|
def default_main_tecnology():
|
|
return None
|
|
|
|
@staticmethod
|
|
def default_calibration():
|
|
return False
|
|
|
|
@staticmethod
|
|
def default_refurbish():
|
|
return False
|
|
|
|
@fields.depends('mark_category', 'model_category')
|
|
def on_change_mark_category(self):
|
|
if self.mark_category:
|
|
self.model_category = None
|
|
|
|
@classmethod
|
|
def view_attributes(cls):
|
|
return super(Template, cls).view_attributes() + [
|
|
('//page[@id="features"]', 'states', {
|
|
'invisible': ~Eval('equipment'),
|
|
})]
|
|
|