changes menores
This commit is contained in:
parent
35ea0a037c
commit
569db4ba4b
@ -22,9 +22,9 @@ msgctxt "field:product.template,equipment:"
|
|||||||
msgid "It is equipment"
|
msgid "It is equipment"
|
||||||
msgstr "Es equipo"
|
msgstr "Es equipo"
|
||||||
|
|
||||||
msgctxt "field:product.template,equipment:"
|
msgctxt "field:product.template,electrical_equipment:"
|
||||||
msgid "It is equipment"
|
msgid "Electrical Equipment"
|
||||||
msgstr "Es equipo"
|
msgstr "Equipo Eléctrico"
|
||||||
|
|
||||||
msgctxt "field:product.template,maintenance_activity:"
|
msgctxt "field:product.template,maintenance_activity:"
|
||||||
msgid "Maintenance Activity"
|
msgid "Maintenance Activity"
|
||||||
|
43
product.py
43
product.py
@ -101,11 +101,12 @@ class Template(metaclass=PoolMeta):
|
|||||||
# for manage of class 'product.template'
|
# for manage of class 'product.template'
|
||||||
|
|
||||||
|
|
||||||
temperature = fields.Float("Temperature")
|
temperature_init = fields.Float("Ti")
|
||||||
|
temperature_end = fields.Float("Tf")
|
||||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
|
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
|
||||||
states={'invisible' : If(Eval('temperature') == None, True)},
|
states={'invisible' : If(Eval('temperature_init') == None, True)},
|
||||||
depends=['temperature']
|
depends=['itemperature_init']
|
||||||
)
|
)
|
||||||
frequency = fields.Float("Frequency")
|
frequency = fields.Float("Frequency")
|
||||||
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||||
@ -113,19 +114,30 @@ class Template(metaclass=PoolMeta):
|
|||||||
states={'invisible' : If(Eval('frequency') == None, True)},
|
states={'invisible' : If(Eval('frequency') == None, True)},
|
||||||
depends=['frequency']
|
depends=['frequency']
|
||||||
)
|
)
|
||||||
moisture = fields.Float("Moisture")
|
moisture_init = fields.Float("Mi")
|
||||||
|
moisture_end = fields.Float("Mf")
|
||||||
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
||||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
|
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
|
||||||
states={'invisible' : If(Eval('moisture') == None, True)},
|
states={'invisible' : If(Eval('moisture_init') == None, True)},
|
||||||
depends=['moisture']
|
depends=['moisture_init']
|
||||||
)
|
)
|
||||||
voltageAC = fields.Float("Voltage AC")
|
electrical_equipment = fields.Boolean("Electrical Equipment")
|
||||||
|
frequency = fields.Float("Frequency",
|
||||||
|
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||||
|
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||||
|
domain=[('category', '=', Id('optical_equipment', 'uom_cat_frequency'))],
|
||||||
|
states={'invisible' : If(Eval('frequency') == None, True)},
|
||||||
|
depends=['frequency']
|
||||||
|
)
|
||||||
|
voltageAC = fields.Float("Voltage AC",
|
||||||
|
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||||
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM",
|
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM",
|
||||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))],
|
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))],
|
||||||
states={'invisible' : If(Eval('voltageAC') == None, True)},
|
states={'invisible' : If(Eval('voltageAC') == None, True)},
|
||||||
depends=['voltageAC']
|
depends=['voltageAC']
|
||||||
)
|
)
|
||||||
voltageDC = fields.Float("Voltage DC")
|
voltageDC = fields.Float("Voltage DC",
|
||||||
|
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||||
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM",
|
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM",
|
||||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))],
|
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))],
|
||||||
states={'invisible' : If(Eval('voltageDC') == None, True)},
|
states={'invisible' : If(Eval('voltageDC') == None, True)},
|
||||||
@ -204,6 +216,7 @@ class Template(metaclass=PoolMeta):
|
|||||||
def default_refurbish():
|
def default_refurbish():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@fields.depends('equipment', 'replacement')
|
@fields.depends('equipment', 'replacement')
|
||||||
def on_change_equipment(self):
|
def on_change_equipment(self):
|
||||||
if self.equipment:
|
if self.equipment:
|
||||||
@ -221,6 +234,13 @@ class Template(metaclass=PoolMeta):
|
|||||||
if not self.model_category:
|
if not self.model_category:
|
||||||
self.reference_category = None
|
self.reference_category = None
|
||||||
|
|
||||||
|
@fields.depends('electrical_equipment')
|
||||||
|
def on_change_electrical_equipment(self):
|
||||||
|
if self.electrical_equipment:
|
||||||
|
self.voltageAC = None
|
||||||
|
self.voltageDC = None
|
||||||
|
self.frequency = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def view_attributes(cls):
|
def view_attributes(cls):
|
||||||
return super(Template, cls).view_attributes() + [
|
return super(Template, cls).view_attributes() + [
|
||||||
@ -228,5 +248,12 @@ class Template(metaclass=PoolMeta):
|
|||||||
'invisible': ~Eval('equipment'),
|
'invisible': ~Eval('equipment'),
|
||||||
})]
|
})]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def view_attributes(cls):
|
||||||
|
return super(Template, cls).view_attributes() + [
|
||||||
|
('//page[@id="calibration"]', 'states', {
|
||||||
|
'invisible': ~Eval('calibration'),
|
||||||
|
})]
|
||||||
|
|
||||||
class Product(metaclass=PoolMeta):
|
class Product(metaclass=PoolMeta):
|
||||||
__name__ = 'product.product'
|
__name__ = 'product.product'
|
||||||
|
@ -42,6 +42,13 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="observation"/>
|
<field name="observation"/>
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="/form/notebook/page[@id='features']" position="after">
|
||||||
|
<page string="Calibration" id="calibration">
|
||||||
|
<newline/>
|
||||||
|
<label name="calibration"/>
|
||||||
|
<field name="calibration"/>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
<xpath expr="/form/notebook/page[@id='measurements']/label[@name='length']" position="before">
|
<xpath expr="/form/notebook/page[@id='measurements']/label[@name='length']" position="before">
|
||||||
<separator id="measurements_equipment" string="Measurements of Equipment" colspan="4"/>
|
<separator id="measurements_equipment" string="Measurements of Equipment" colspan="4"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
@ -49,16 +56,25 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
expr="/form/notebook/page[@id='measurements']" position="inside">
|
expr="/form/notebook/page[@id='measurements']" position="inside">
|
||||||
<separator id="enviromental_conditions" string="Enviromental Conditions" colspan="4"/>
|
<separator id="enviromental_conditions" string="Enviromental Conditions" colspan="4"/>
|
||||||
|
|
||||||
<label name="temperature"/>
|
<label name="temperature_init"/>
|
||||||
<field name="temperature"/>
|
<field name="temperature_init"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="temperature_end"/>
|
||||||
|
<field name="temperature_end"/>
|
||||||
<field name="temperature_uom"/>
|
<field name="temperature_uom"/>
|
||||||
|
<newline/>
|
||||||
<label name="moisture"/>
|
<label name="moisture_init"/>
|
||||||
<field name="moisture"/>
|
<field name="moisture_init"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="moisture_end"/>
|
||||||
|
<field name="moisture_end"/>
|
||||||
<field name="moisture_uom"/>
|
<field name="moisture_uom"/>
|
||||||
|
|
||||||
<separator id="electrical_conditions" string="Electrical Conditions" colspan="4"/>
|
<separator id="electrical_conditions" string="Electrical Conditions" colspan="4"/>
|
||||||
|
|
||||||
|
<label name="electrical_equipment"/>
|
||||||
|
<field name="electrical_equipment"/>
|
||||||
|
<newline/>
|
||||||
<label name="frequency"/>
|
<label name="frequency"/>
|
||||||
<field name="frequency"/>
|
<field name="frequency"/>
|
||||||
<field name="frequency_uom"/>
|
<field name="frequency_uom"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user