view invisible in 'features' and 'calibration'
This commit is contained in:
parent
720710e094
commit
af32d1c9fb
37
product.py
37
product.py
@ -7,7 +7,7 @@ from trytond.pyson import Bool, If, Eval, Id
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
|
||||
_RISK = [('N/A', "No aplíca"),
|
||||
_RISK = [('n/a', "No aplíca"),
|
||||
('uno', 'I'),
|
||||
('dosA', 'IIA'),
|
||||
('dosB', 'IIB')]
|
||||
@ -18,7 +18,7 @@ _USE = [('', ""),
|
||||
('apoyo', 'Apoyo')]
|
||||
|
||||
_BIOMEDICAL_CLASS = [
|
||||
('N/A', "No aplíca"),
|
||||
('n/a', "No aplíca"),
|
||||
('diagnostico', 'Diagnóstico'),
|
||||
('rehabilitación', 'Rehabilitación')]
|
||||
|
||||
@ -166,7 +166,17 @@ class Template(metaclass=PoolMeta):
|
||||
states={'invisible': If(Eval('resolution_type') != 'analoga', True)},
|
||||
depends=['resolution_type'])
|
||||
Usubi = fields.Integer("Usub i")
|
||||
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Template, cls).view_attributes() + [
|
||||
('//page[@id="features"]', 'states', {
|
||||
'invisible': ~Eval('equipment'),
|
||||
}),
|
||||
('//page[@id="calibration"]', 'states', {
|
||||
'invisible': ~Eval('calibration')},)
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@fields.depends('temperature')
|
||||
def default_temperature_uom(self):
|
||||
@ -211,7 +221,7 @@ class Template(metaclass=PoolMeta):
|
||||
|
||||
@staticmethod
|
||||
def default_risk():
|
||||
return None
|
||||
return 'n/a'
|
||||
|
||||
@staticmethod
|
||||
def default_use():
|
||||
@ -219,7 +229,7 @@ class Template(metaclass=PoolMeta):
|
||||
|
||||
@staticmethod
|
||||
def default_biomedical_class():
|
||||
return None
|
||||
return 'n/a'
|
||||
|
||||
@staticmethod
|
||||
def default_main_tecnology():
|
||||
@ -243,6 +253,7 @@ class Template(metaclass=PoolMeta):
|
||||
if self.equipment:
|
||||
self.replacement=False
|
||||
self.maintenance_activity=False
|
||||
self.calibration=False
|
||||
|
||||
@fields.depends('mark_category', 'model_category', 'reference_category')
|
||||
def on_change_mark_category(self):
|
||||
@ -260,21 +271,7 @@ class Template(metaclass=PoolMeta):
|
||||
if self.electrical_equipment:
|
||||
self.voltageAC = None
|
||||
self.voltageDC = None
|
||||
self.frequency = None
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Template, cls).view_attributes() + [
|
||||
('//page[@id="features"]', 'states', {
|
||||
'invisible': ~Eval('equipment'),
|
||||
})]
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Template, cls).view_attributes() + [
|
||||
('//page[@id="calibration"]', 'states', {
|
||||
'invisible': ~Eval('calibration'),
|
||||
})]
|
||||
self.frequency = None
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
||||
__name__ = 'product.product'
|
||||
|
Loading…
Reference in New Issue
Block a user