modification to template of products
This commit is contained in:
parent
98b33d8b8c
commit
141cb90ead
14
equipment.py
14
equipment.py
@ -12,20 +12,20 @@ class OpticalEquipment(ModelSQL, ModelView):
|
|||||||
propietary = fields.Many2One('party.party', "Propietary")
|
propietary = fields.Many2One('party.party', "Propietary")
|
||||||
propietary_address = fields.Many2One('party.address', "Propietary Address", required=True)
|
propietary_address = fields.Many2One('party.address', "Propietary Address", required=True)
|
||||||
product = fields.Many2One('product.product', "Product")
|
product = fields.Many2One('product.product', "Product")
|
||||||
refurbish = fields.Boolean("Refurbish")
|
refurbish = fields.Boolean("Refurbish", readonly=True)
|
||||||
equipment_type = fields.Char('type')
|
equipment_type = fields.Char('type', readonly=True)
|
||||||
risk = fields.Char('Type risk')
|
risk = fields.Char('Type risk')
|
||||||
use = fields.Char('Use')
|
use = fields.Char('Use')
|
||||||
biomedical_class = fields.Char('Biomedical Class')
|
biomedical_class = fields.Char('Biomedical Class')
|
||||||
main_tecnology = fields.Char('Main tecnology')
|
main_tecnology = fields.Char('Main tecnology')
|
||||||
calibration = fields.Boolean("Apply calibration")
|
calibration = fields.Boolean("Apply calibration", readonly=True)
|
||||||
mark_category = fields.Many2One('product.category', 'Mark')
|
mark_category = fields.Many2One('product.category', 'Mark', required=True)
|
||||||
model_category = fields.Many2One('product.category', "Model")
|
model_category = fields.Many2One('product.category', "Model", required=True)
|
||||||
reference = fields.Char("Reference", size=None)
|
reference = fields.Char("Reference", size=None)
|
||||||
origin_country = fields.Many2One('country.country',"Origin Country")
|
origin_country = fields.Many2One('country.country',"Origin Country")
|
||||||
software_version = fields.Char("Software version", size=None)
|
software_version = fields.Char("Software version", size=None)
|
||||||
useful_life = fields.Char("Useful life", size=None)
|
useful_life = fields.Integer("Useful life")
|
||||||
warranty = fields.Char("Warranty", size=None)
|
warranty = fields.Integer("Warranty")
|
||||||
serial = fields.Char("Serial", size=None)
|
serial = fields.Char("Serial", size=None)
|
||||||
health_register = fields.Char("Health Register", size=None)
|
health_register = fields.Char("Health Register", size=None)
|
||||||
|
|
||||||
|
42
product.py
42
product.py
@ -11,24 +11,32 @@ from trytond.exceptions import UserError
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
_RISK = [('uno', 'I'),
|
_RISK = [('', ""),
|
||||||
|
('uno', 'I'),
|
||||||
('dosA', 'IIA'),
|
('dosA', 'IIA'),
|
||||||
('dosB', 'IIB')]
|
('dosB', 'IIB')]
|
||||||
|
|
||||||
_USE = [('medico', 'Médico'),
|
_USE = [('', ""),
|
||||||
|
('medico', 'Médico'),
|
||||||
('basico', 'Basico'),
|
('basico', 'Basico'),
|
||||||
('apoyo', 'Apoyo')]
|
('apoyo', 'Apoyo')]
|
||||||
|
|
||||||
_BIOMEDICAL_CLASS = [('diagnostico', 'Diagnóstico'),
|
_BIOMEDICAL_CLASS = [
|
||||||
|
('', ""),
|
||||||
|
('diagnostico', 'Diagnóstico'),
|
||||||
('rehabilitación', 'Rehabilitación')]
|
('rehabilitación', 'Rehabilitación')]
|
||||||
|
|
||||||
_MAIN_TECNOLOGY = [('mecanico', 'Mecánico'),
|
_MAIN_TECNOLOGY = [
|
||||||
|
('', ""),
|
||||||
|
('mecanico', 'Mecánico'),
|
||||||
('electrico', 'Electrico'),
|
('electrico', 'Electrico'),
|
||||||
('electronico', 'Electrónico'),
|
('electronico', 'Electrónico'),
|
||||||
('hidraulico', 'Hidraulico'),
|
('hidraulico', 'Hidraulico'),
|
||||||
('neumatico', 'Neumatico')]
|
('neumatico', 'Neumatico')]
|
||||||
|
|
||||||
_EQUIPMENT_TYPE = [('mobiliario_optico', 'Mobiliario óptico'),
|
_EQUIPMENT_TYPE = [
|
||||||
|
('', ""),
|
||||||
|
('mobiliario_optico', 'Mobiliario óptico'),
|
||||||
('refraccion', 'Refracción'),
|
('refraccion', 'Refracción'),
|
||||||
('medico', 'Medicion'),
|
('medico', 'Medicion'),
|
||||||
('accesorios', 'Accesorios')]
|
('accesorios', 'Accesorios')]
|
||||||
@ -39,13 +47,13 @@ class Template(metaclass=PoolMeta):
|
|||||||
__name__ = 'product.template'
|
__name__ = 'product.template'
|
||||||
|
|
||||||
equipment = fields.Boolean('It is equipment')
|
equipment = fields.Boolean('It is equipment')
|
||||||
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type')
|
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type', required=True)
|
||||||
risk = fields.Selection(_RISK, 'Type risk')
|
risk = fields.Selection(_RISK, 'Type risk')
|
||||||
use = fields.Selection(_USE, 'Use')
|
use = fields.Selection(_USE, 'Use', required=True)
|
||||||
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS,
|
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS,
|
||||||
'Biomedical Class')
|
'Biomedical Class', required=True)
|
||||||
main_tecnology = fields.Selection(_MAIN_TECNOLOGY,
|
main_tecnology = fields.Selection(_MAIN_TECNOLOGY,
|
||||||
'Main tecnology')
|
'Main tecnology', required=True)
|
||||||
calibration = fields.Boolean("Apply calibration")
|
calibration = fields.Boolean("Apply calibration")
|
||||||
observation = fields.Text('Observation')
|
observation = fields.Text('Observation')
|
||||||
mark_category = fields.Many2One('product.category', 'Mark')
|
mark_category = fields.Many2One('product.category', 'Mark')
|
||||||
@ -54,14 +62,6 @@ class Template(metaclass=PoolMeta):
|
|||||||
origin_country = fields.Many2One('country.country',"Origin Country")
|
origin_country = fields.Many2One('country.country',"Origin Country")
|
||||||
software_version = fields.Char(
|
software_version = fields.Char(
|
||||||
"Software version", size=None)
|
"Software version", size=None)
|
||||||
useful_life = fields.Char(
|
|
||||||
"Useful life", size=None)
|
|
||||||
warranty = fields.Char(
|
|
||||||
"Warranty")
|
|
||||||
serial = fields.Char(
|
|
||||||
"Serial", size=None)
|
|
||||||
health_register = fields.Char(
|
|
||||||
"Health_Register", size=None)
|
|
||||||
refurbish = fields.Boolean('Refurbish')
|
refurbish = fields.Boolean('Refurbish')
|
||||||
|
|
||||||
#These are measurements required for the equipments, are in this place
|
#These are measurements required for the equipments, are in this place
|
||||||
@ -82,8 +82,12 @@ class Template(metaclass=PoolMeta):
|
|||||||
voltageDC = fields.Float("Voltage DC")
|
voltageDC = fields.Float("Voltage DC")
|
||||||
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'))])
|
||||||
|
useful_life = fields.Integer("Useful life")
|
||||||
|
useful_life_uom = fields.Many2One('product.uom', 'Useful Life UOM',
|
||||||
|
domain=[('category', '=', Id('product', "uom_cat_time"))])
|
||||||
|
warranty = fields.Integer("Warranty")
|
||||||
|
warranty_uom = fields.Many2One('product.uom', 'Useful Life UOM',
|
||||||
|
domain=[('category', '=', Id('product', "uom_cat_time"))])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_equipment():
|
def default_equipment():
|
||||||
|
17
purchase.py
17
purchase.py
@ -35,13 +35,20 @@ class Purchase(metaclass=PoolMeta):
|
|||||||
if line.product.equipment:
|
if line.product.equipment:
|
||||||
equipment = Equipment(
|
equipment = Equipment(
|
||||||
company=line.company,
|
company=line.company,
|
||||||
|
location=line.to_location,
|
||||||
equipment_type=line.product.equipment_type,
|
equipment_type=line.product.equipment_type,
|
||||||
|
propietary=line.company,
|
||||||
propietary_address=line.address_equipment,
|
propietary_address=line.address_equipment,
|
||||||
product=line.product,
|
product=line.product,
|
||||||
|
model_category=line.product.model_category,
|
||||||
|
mark_category=line.product.mark_category,
|
||||||
|
useful_life=line.product.useful_life,
|
||||||
|
calibration=line.product.calibration,
|
||||||
|
warranty=line.product.warranty,
|
||||||
risk=line.product.risk,
|
risk=line.product.risk,
|
||||||
|
origin_country=line.product.origin_country,
|
||||||
use=line.product.use,
|
use=line.product.use,
|
||||||
biomedical_class=line.product.biomedical_class,
|
biomedical_class=line.product.biomedical_class,
|
||||||
calibration=line.product.calibration,
|
|
||||||
refurbish=line.refurbish,
|
refurbish=line.refurbish,
|
||||||
serial=line.serial_equipment,
|
serial=line.serial_equipment,
|
||||||
software_version=line.product.software_version)
|
software_version=line.product.software_version)
|
||||||
@ -50,7 +57,6 @@ class Purchase(metaclass=PoolMeta):
|
|||||||
continue
|
continue
|
||||||
purchase.equipment_available = True
|
purchase.equipment_available = True
|
||||||
cls.save(purchases)
|
cls.save(purchases)
|
||||||
#raise UserError(str(purchase.equipment_available))
|
|
||||||
else:
|
else:
|
||||||
raise InvalidNumberPurchases(
|
raise InvalidNumberPurchases(
|
||||||
gettext('purchase.msg_invalid_number_purchases'))
|
gettext('purchase.msg_invalid_number_purchases'))
|
||||||
@ -59,11 +65,18 @@ class Purchase(metaclass=PoolMeta):
|
|||||||
class Line(metaclass=PoolMeta):
|
class Line(metaclass=PoolMeta):
|
||||||
__name__ = 'purchase.line'
|
__name__ = 'purchase.line'
|
||||||
|
|
||||||
|
origin_country = origin_country = fields.Many2One('country.country',"Origin Country")
|
||||||
address_equipment = fields.Many2One('party.address', "Direccion", required=True)
|
address_equipment = fields.Many2One('party.address', "Direccion", required=True)
|
||||||
serial_equipment = fields.Char("Serial", size=None, required=True)
|
serial_equipment = fields.Char("Serial", size=None, required=True)
|
||||||
refurbish = fields.Boolean("Refurbish")
|
refurbish = fields.Boolean("Refurbish")
|
||||||
product_equipment = fields.Boolean("Product Equipment")
|
product_equipment = fields.Boolean("Product Equipment")
|
||||||
|
|
||||||
|
"""
|
||||||
|
def default_origin_country(self):
|
||||||
|
if self.product:
|
||||||
|
return self.product.origin_country
|
||||||
|
"""
|
||||||
|
|
||||||
def on_change_product(self):
|
def on_change_product(self):
|
||||||
if not self.product:
|
if not self.product:
|
||||||
self.product_equipment = False
|
self.product_equipment = False
|
||||||
|
@ -8,14 +8,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
||||||
<page string="Features" id="features">
|
<page string="Features" id="features">
|
||||||
|
<label name="reference"/>
|
||||||
|
<field name="reference"/>
|
||||||
<label name="mark_category"/>
|
<label name="mark_category"/>
|
||||||
<field name="mark_category"/>
|
<field name="mark_category"/>
|
||||||
<label name="model_category"/>
|
<label name="model_category"/>
|
||||||
<field name="model_category"/>
|
<field name="model_category"/>
|
||||||
<label name="serial"/>
|
|
||||||
<field name="serial"/>
|
|
||||||
<label name="health_register"/>
|
|
||||||
<field name="health_register"/>
|
|
||||||
<label name="equipment_type"/>
|
<label name="equipment_type"/>
|
||||||
<field name="equipment_type"/>
|
<field name="equipment_type"/>
|
||||||
<label name="calibration"/>
|
<label name="calibration"/>
|
||||||
@ -32,16 +30,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="main_tecnology"/>
|
<field name="main_tecnology"/>
|
||||||
<label name="software_version"/>
|
<label name="software_version"/>
|
||||||
<field name="software_version"/>
|
<field name="software_version"/>
|
||||||
<label name="useful_life"/>
|
|
||||||
<field name="useful_life"/>
|
|
||||||
<label name="warranty"/>
|
|
||||||
<field name="warranty"/>
|
|
||||||
<label name="observation"/>
|
<label name="observation"/>
|
||||||
<field name="observation"/>
|
<field name="observation"/>
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="/form/notebook/page[@id='measurements']" position="inside">
|
<xpath
|
||||||
|
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"/>
|
||||||
@ -66,5 +60,13 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<label name="voltageDC"/>
|
<label name="voltageDC"/>
|
||||||
<field name="voltageDC"/>
|
<field name="voltageDC"/>
|
||||||
<field name="voltageDC_uom"/>
|
<field name="voltageDC_uom"/>
|
||||||
|
|
||||||
|
<label name="useful_life"/>
|
||||||
|
<field name="useful_life"/>
|
||||||
|
<field name="useful_life_uom"/>
|
||||||
|
|
||||||
|
<label name="warranty"/>
|
||||||
|
<field name="warranty"/>
|
||||||
|
<field name="warranty_uom"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
Loading…
Reference in New Issue
Block a user