Se añade tecnico responsable
This commit is contained in:
parent
4019750629
commit
92113f32cf
@ -1,14 +1,16 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from . import (agended, balance_sale_party, calibration, configuration, contract, diary,
|
||||
equipment, party, product, maintenance, move, purchase, sale)
|
||||
from . import (agended, balance_sale_party, calibration, configuration,
|
||||
contract, company, diary, equipment, party, product,
|
||||
maintenance, move, purchase, sale)
|
||||
|
||||
__all__ = ['register']
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
company.Emplyee,
|
||||
equipment.OpticalEquipment,
|
||||
equipment.EquipmentMaintenance,
|
||||
equipment.EquipmentContract,
|
||||
|
9
company.py
Normal file
9
company.py
Normal file
@ -0,0 +1,9 @@
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.model import fields
|
||||
|
||||
|
||||
class Emplyee(metaclass=PoolMeta):
|
||||
'Company'
|
||||
__name__ = 'company.employee'
|
||||
|
||||
invima = fields.Char('Invima')
|
10
company.xml
Normal file
10
company.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level
|
||||
of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<record model="ir.ui.view" id="employee_view_form">
|
||||
<field name="model">company.employee</field>
|
||||
<field name="inherit" ref="company.employee_view_form"/>
|
||||
<field name="name">employee_form</field>
|
||||
</record>
|
||||
</tryton>
|
@ -1,33 +1,51 @@
|
||||
from trytond.model import (
|
||||
ModelSingleton, ModelSQL, ModelView, fields)
|
||||
from trytond.pyson import Id
|
||||
from trytond.modules.company.model import (
|
||||
CompanyMultiValueMixin, CompanyValueMixin)
|
||||
from trytond.pyson import Id, Eval
|
||||
|
||||
|
||||
class Configuration(ModelSingleton, ModelSQL, ModelView, CompanyMultiValueMixin):
|
||||
class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
'Equipment Configuration'
|
||||
__name__='optical_equipment.configuration'
|
||||
__name__ = 'optical_equipment.configuration'
|
||||
|
||||
equipment_sequence = fields.Many2One('ir.sequence', "Equipment Sequence",
|
||||
domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_equipment'))])
|
||||
maintenance_sequence = fields.Many2One('ir.sequence', "Maintenance Sequence",
|
||||
domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_maintenances'))])
|
||||
agended_sequence = fields.Many2One('ir.sequence', "Agended Sequence",
|
||||
domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_agended'))])
|
||||
contract_sequence = fields.Many2One('ir.sequence', "Contract Sequence",
|
||||
domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_contract'))])
|
||||
technician_responsible = fields.Many2One(
|
||||
'company.employee', "Technician Responsible")
|
||||
invima = fields.Char('Invima', states={
|
||||
'required': Eval('technician_responsible', True)
|
||||
})
|
||||
equipment_sequence = fields.Many2One(
|
||||
'ir.sequence', "Equipment Sequence", domain=[
|
||||
('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_equipment'))])
|
||||
maintenance_sequence = fields.Many2One(
|
||||
'ir.sequence', "Maintenance Sequence",
|
||||
domain=[('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_maintenances'))])
|
||||
agended_sequence = fields.Many2One(
|
||||
'ir.sequence', "Agended Sequence",
|
||||
domain=[('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_agended'))])
|
||||
contract_sequence = fields.Many2One(
|
||||
'ir.sequence', "Contract Sequence", domain=[
|
||||
('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_contract'))])
|
||||
temperature_min = fields.Float("Temp Min")
|
||||
temperature_max = fields.Float("Temp Max")
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
|
||||
temperature_uom = fields.Many2One(
|
||||
'product.uom', 'Temperature UOM',
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', "uom_cat_temperature"))],
|
||||
depends={'itemperature_min'})
|
||||
moisture_min = fields.Float("Moisture Min")
|
||||
moisture_max = fields.Float("Moisture Max")
|
||||
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
moisture_uom = fields.Many2One(
|
||||
'product.uom', "Moisture UOM",
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
depends={'moisture_min'})
|
||||
sale_quote_number = fields.Many2One('ir.sequence', "Sale Quote Number",
|
||||
domain=[
|
||||
('sequence_type', '=', Id('sale','sequence_type_sale'))
|
||||
('sequence_type', '=', Id(
|
||||
'sale', 'sequence_type_sale'))
|
||||
])
|
||||
|
171
maintenance.py
171
maintenance.py
@ -83,8 +83,10 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
'readonly': If(Eval('state') == 'finished', True),
|
||||
'required': If(Eval('state') == 'in_progress', True)})
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
|
||||
states={'invisible': If(Eval('temperature_min') == None, True),
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', "uom_cat_temperature"))],
|
||||
states={'invisible': If(Eval('temperature_min') is None, True),
|
||||
'readonly': (Eval('state') == 'finished'),
|
||||
'required': If(Eval('state') == 'in_progress', True)},)
|
||||
moisture_min = fields.Float("Moisture Min", states={
|
||||
@ -94,8 +96,10 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
'readonly': If(Eval('state') == 'finished', True),
|
||||
'required': If(Eval('state') == 'in_progress', True)})
|
||||
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
states={'invisible' : If(Eval('moisture_min') == None, True),
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
states={'invisible': If(Eval('moisture_min') is None, True),
|
||||
'readonly': Eval('state') == 'finished',
|
||||
'required': If(Eval('state') == 'in_progress', True)},)
|
||||
|
||||
@ -234,7 +238,7 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
pool = Pool()
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
config = Config(2)
|
||||
if config.maintenance_sequence != None:
|
||||
if config.maintenance_sequence is not None:
|
||||
if not maintenance.code:
|
||||
try:
|
||||
maintenance.code = config.maintenance_sequence.get()
|
||||
@ -305,47 +309,68 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
('propietary_address', '=', Eval('propietary_address'))],
|
||||
states=_states,)
|
||||
equipment_calibrate = fields.Boolean("Calibrate Equipment", states={'readonly': True})
|
||||
#when the maintenance is in agended status
|
||||
# when the maintenance is in agended status
|
||||
diary = fields.One2Many('optical_equipment_maintenance.diary', 'diary')
|
||||
#Preventive maintenance
|
||||
# Preventive maintenance
|
||||
initial_operation = fields.Boolean("Verificación inicial de funcionamiento")
|
||||
check_equipment = fields.Boolean("Revisión del Equipo")
|
||||
check_electric_system = fields.Boolean("Revisión del sistema electríco")
|
||||
clean_int_ext = fields.Boolean("Limpieza interior y exterior")
|
||||
clean_eyes = fields.Boolean("Limpieza de lentes y espejos")
|
||||
check_calibration = fields.Boolean("Verificar Calibración")
|
||||
maintenance_activity = fields.One2Many('optical_equipment_maintenance.activity', 'maintenance', "Maintenance Activitys")
|
||||
#Calibration
|
||||
maintenance_activity = fields.One2Many(
|
||||
'optical_equipment_maintenance.activity',
|
||||
'maintenance',
|
||||
"Maintenance Activitys")
|
||||
# Calibration
|
||||
patterns_equipments = fields.Char("K Pattern", states={'readonly': True},)
|
||||
lines_calibration = fields.One2Many('optical_equipment.maintenance.calibration_sample', 'maintenance', "Lines of Calibration",
|
||||
states={'readonly': Eval('state') == 'finished'})
|
||||
calibration_total = fields.One2Many('optical_equipment.maintenance.calibration', 'maintenance', "Calibration Total",
|
||||
states={'readonly': Eval('state') == 'finished'})
|
||||
maintenance_lines = fields.One2Many('optical_equipment.maintenance.line', 'maintenance', 'Lines')
|
||||
maintenance_lines = fields.One2Many(
|
||||
'optical_equipment.maintenance.line', 'maintenance', 'Lines')
|
||||
description_activity = fields.Char('Activity')
|
||||
next_maintenance = fields.Function(fields.Date('Next Maintenance'), 'get_next_maintenance')
|
||||
temperature_min = fields.Float("Temp Min")
|
||||
temperature_max = fields.Float("Temp Max")
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
|
||||
states={'invisible': If(Eval('temperature_min') == None, True),
|
||||
'readonly' : (Eval('state') == 'finished')},)
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', "uom_cat_temperature"))],
|
||||
states={'invisible': If(Eval('temperature_min') is None, True),
|
||||
'readonly': (Eval('state') == 'finished')},)
|
||||
moisture_min = fields.Float("Moisture Min")
|
||||
moisture_max = fields.Float("Moisture Max")
|
||||
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
states={'invisible' : If(Eval('moisture_min') == None, True),
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
states={'invisible': If(Eval('moisture_min') is None, True),
|
||||
'readonly': Eval('state') == 'finished'},)
|
||||
graph_calibration = fields.Binary('Graphs')
|
||||
rec_name = fields.Function(fields.Char('rec_name'), 'get_rec_name')
|
||||
|
||||
# @fields.depends('maintenance_type', 'code')
|
||||
# def get_rec_name(self, name):
|
||||
# if self.maintenance_type and self.code:
|
||||
# name = str(self.maintenance_type) + '@' + str(self.code)
|
||||
# else:
|
||||
# name = str(self.maintenance_type) + '@' + 'Borrador'
|
||||
# return name
|
||||
technician_responsible = fields.Char('Technician Responsible')
|
||||
invima = fields.Char('Invima')
|
||||
|
||||
@classmethod
|
||||
def default_technician_responsible(cls):
|
||||
pool = Pool()
|
||||
ConfigurationEquipment = pool.get('optical_equipment.configuration')
|
||||
config = ConfigurationEquipment(1)
|
||||
|
||||
if config.technician_responsible:
|
||||
technician_responsible = config.technician_responsible
|
||||
return technician_responsible.party.name
|
||||
|
||||
@classmethod
|
||||
def default_invima(cls):
|
||||
pool = Pool()
|
||||
ConfigurationEquipment = pool.get('optical_equipment.configuration')
|
||||
config = ConfigurationEquipment(1)
|
||||
if config.technician_responsible.invima:
|
||||
return config.technician_responsible.invima
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@ -359,7 +384,7 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
((Eval('maintenance_type') == 'corrective') & (Eval('maintenance_lines') == ()))},
|
||||
'samples': {'invisible': (Eval('state').in_(['finished'])) | (Eval('lines_calibration') != ()) | (~Eval('equipment_calibrate'))},
|
||||
'calibrate': {'invisible': (Eval('lines_calibration') == ()) | (Eval('state').in_(['finished'])),
|
||||
'depends': ['state'],}
|
||||
'depends': ['state'], }
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ -368,18 +393,17 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
('//page[@id="preventive"]', 'states', {
|
||||
'invisible': If(Eval('maintenance_type') == 'corrective', True),
|
||||
}),
|
||||
('//page[@id="corrective"]', 'states',{
|
||||
('//page[@id="corrective"]', 'states', {
|
||||
'invisible': If(Eval('maintenance_type') != 'corrective', True),
|
||||
}),
|
||||
('//page[@id="calibration"]', 'states',{
|
||||
('//page[@id="calibration"]', 'states', {
|
||||
'invisible': ~Eval('equipment_calibrate'),
|
||||
}),
|
||||
('//page[@id="graph"]', 'states',{
|
||||
('//page[@id="graph"]', 'states', {
|
||||
'invisible': ~Eval('equipment_calibrate'),
|
||||
})
|
||||
]
|
||||
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
@ -469,7 +493,7 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
sum_samples = sum(samples)
|
||||
n_samples = len(samples)
|
||||
mean = sum_samples / n_samples
|
||||
dev_std_square = sum((l-mean)**2 for l in samples) / (n_samples - 1)
|
||||
dev_std_square = sum((l - mean)**2 for l in samples) / (n_samples - 1)
|
||||
dev_std = mt.sqrt(dev_std_square)
|
||||
|
||||
return dev_std
|
||||
@ -480,7 +504,7 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
uncertain type A
|
||||
"""
|
||||
n_samples = len(samples)
|
||||
uncertain_type_A = dev_std /mt.sqrt(n_samples)
|
||||
uncertain_type_A = dev_std / mt.sqrt(n_samples)
|
||||
|
||||
return uncertain_type_A
|
||||
|
||||
@ -507,7 +531,7 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
return d
|
||||
|
||||
def get_uncertain_b2_digital(self):
|
||||
uncertain_b2 = d/2*mt.sqrt(3)
|
||||
uncertain_b2 = d / 2 * mt.sqrt(3)
|
||||
|
||||
return uncertain_b2
|
||||
|
||||
@ -516,7 +540,7 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
Incertidumbre por resolución Análoga
|
||||
a contante que viene del equipo
|
||||
"""
|
||||
uncertain_b2_analog = d/a * math.sqrt(3)
|
||||
uncertain_b2_analog = d / a * math.sqrt(3)
|
||||
|
||||
return uncertain_b2_analog
|
||||
|
||||
@ -533,7 +557,9 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
"""
|
||||
Grados Efectivos de libertad
|
||||
"""
|
||||
uncertain_eff = uncertain_c**4/((uncertain_type_A**4)/(len(sample)-1)+(uncertain_b1**4/U_subi)+(uncertain_b2**4/U_subi))
|
||||
uncertain_eff = uncertain_c**4 / \
|
||||
((uncertain_type_A**4) / (len(sample) - 1) +
|
||||
(uncertain_b1**4 / U_subi) + (uncertain_b2**4 / U_subi))
|
||||
|
||||
return uncertain_eff
|
||||
|
||||
@ -542,15 +568,15 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
errors = []
|
||||
yerr = []
|
||||
|
||||
upresolution = resolution if resolution >=0 else (resolution*-1)
|
||||
lowresolution = resolution if resolution < 0 else (resolution*-1)
|
||||
upresolution = resolution if resolution >= 0 else (resolution * -1)
|
||||
lowresolution = resolution if resolution < 0 else (resolution * -1)
|
||||
|
||||
count = 0
|
||||
for pattern in patterns:
|
||||
error = pattern - matrix[count][0]
|
||||
yerr.append(matrix[count][1])
|
||||
errors.append(error)
|
||||
count+=1
|
||||
count += 1
|
||||
|
||||
labels = list(patterns)
|
||||
|
||||
@ -571,10 +597,10 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
ls = 'dotted'
|
||||
fig, ax1 = plt.subplots(nrows=1, ncols=1)
|
||||
|
||||
## Límites del Eje Y
|
||||
# Límites del Eje Y
|
||||
ax1.set_ylim(bottom, top)
|
||||
## Límites del Eje X
|
||||
ax1.set_xlim((min(labels)-1, max(labels)+1))
|
||||
# Límites del Eje X
|
||||
ax1.set_xlim((min(labels) - 1, max(labels) + 1))
|
||||
|
||||
ax1.yaxis.grid(True)
|
||||
ax1.xaxis.grid(True)
|
||||
@ -583,8 +609,8 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
ax1.set_xlabel('Patrones')
|
||||
ax1.set_ylabel('Valores Observados')
|
||||
|
||||
ax1.set_yticks([lowresolution,0.0,upresolution])
|
||||
#ax1.set_xticks([-10.0,-5.0,0.0,5.0,10.0])
|
||||
ax1.set_yticks([lowresolution, 0.0, upresolution])
|
||||
# ax1.set_xticks([-10.0,-5.0,0.0,5.0,10.0])
|
||||
|
||||
ax1.errorbar(x, y, yerr=yerr, marker='D', markersize=10, linestyle=ls)
|
||||
|
||||
@ -627,8 +653,8 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
value_equipment=pattern.pattern,
|
||||
mistake=0,
|
||||
mistake_rate=0)
|
||||
samples = [calibrationSample]*5
|
||||
maintenance.lines_calibration+=tuple(samples)
|
||||
samples = [calibrationSample] * 5
|
||||
maintenance.lines_calibration += tuple(samples)
|
||||
maintenance.save()
|
||||
|
||||
@classmethod
|
||||
@ -654,35 +680,41 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
|
||||
for pattern in patterns:
|
||||
samples = dates[pattern]
|
||||
mean = sum(samples)/len(samples)
|
||||
mean = sum(samples) / len(samples)
|
||||
U_subi = maintenance.equipment.product.Usubi
|
||||
uncertain_pattern = maintenance.equipment.product.uncertainy_pattern
|
||||
MEP = maintenance.equipment.product.MEP
|
||||
dev_std = cls.get_standard_deviation(samples)
|
||||
uncertain_type_A = cls.get_uncertain_type_A(samples, dev_std)
|
||||
k_certificated_calibration = 2
|
||||
uncertain_b1 = MEP / mt.sqrt(3) #Ub1_patron a 2 Decimales
|
||||
uncertain_b1a = uncertain_pattern / k_certificated_calibration #Ub1_MEP
|
||||
uncertain_b1 = MEP / mt.sqrt(3) # Ub1_patron a 2 Decimales
|
||||
uncertain_b1a = uncertain_pattern / k_certificated_calibration # Ub1_MEP
|
||||
|
||||
if maintenance.equipment.product.resolution_type == "analoga":
|
||||
a_resolution = maintenance.equipment.product.analog_resolution
|
||||
resolution = a_resolution
|
||||
factor_a = maintenance.equipment.product.a_factor_resolution
|
||||
uncertain_b2_analog = (a_resolution) / (factor_a*mt.sqrt(3))
|
||||
sum_uncertain_c = (uncertain_type_A**2) + (uncertain_b1**2) + (uncertain_b2_analog**2)
|
||||
uncertain_b2_analog = (a_resolution) / (factor_a * mt.sqrt(3))
|
||||
sum_uncertain_c = (uncertain_type_A**2) + \
|
||||
(uncertain_b1**2) + (uncertain_b2_analog**2)
|
||||
uncertain_c = mt.sqrt(sum_uncertain_c)
|
||||
uncertain_eff = uncertain_c**4/((uncertain_type_A**4)/(len(samples)-1)+(uncertain_b1**4/U_subi)+(uncertain_b2_analog**4/U_subi))
|
||||
uncertain_eff = uncertain_c**4 / \
|
||||
((uncertain_type_A**4) / (len(samples) - 1) +
|
||||
(uncertain_b1**4 / U_subi) + (uncertain_b2_analog**4 / U_subi))
|
||||
elif maintenance.equipment.product.resolution_type == "digital":
|
||||
d_resolution = maintenance.equipment.product.d_resolution
|
||||
resolution = d_resolution
|
||||
uncertain_b2_digital = (d_resolution) / (2*mt.sqrt(3))
|
||||
sum_uncertain_c = (uncertain_type_A**2) + (uncertain_b1**2) + (uncertain_b2_digital**2)
|
||||
uncertain_b2_digital = (d_resolution) / (2 * mt.sqrt(3))
|
||||
sum_uncertain_c = (uncertain_type_A**2) + \
|
||||
(uncertain_b1**2) + (uncertain_b2_digital**2)
|
||||
uncertain_c = mt.sqrt(sum_uncertain_c)
|
||||
uncertain_eff = uncertain_c**4/((uncertain_type_A**4)/(len(samples)-1)+(uncertain_b1**4/U_subi)+(uncertain_b2_digital**4/U_subi))
|
||||
uncertain_eff = uncertain_c**4 / \
|
||||
((uncertain_type_A**4) / (len(samples) - 1) +
|
||||
(uncertain_b1**4 / U_subi) + (uncertain_b2_digital**4 / U_subi))
|
||||
|
||||
t_student = t.ppf(1-0.025, uncertain_eff)
|
||||
uncertain_expanded = round((t_student * uncertain_c),2)
|
||||
dates_mistake_pattern.append([mean,uncertain_expanded])
|
||||
t_student = t.ppf(1 - 0.025, uncertain_eff)
|
||||
uncertain_expanded = round((t_student * uncertain_c), 2)
|
||||
dates_mistake_pattern.append([mean, uncertain_expanded])
|
||||
|
||||
if maintenance.equipment.product.resolution_type == "analoga":
|
||||
calibrationLineTotal = CalibrationLineTotal(
|
||||
@ -726,7 +758,8 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
|
||||
maintenance.save()
|
||||
|
||||
equipment_risk = maintenance.equipment.product.risk
|
||||
image = cls.get_create_graph(dates_mistake_pattern, patterns, resolution, equipment_risk)
|
||||
image = cls.get_create_graph(
|
||||
dates_mistake_pattern, patterns, resolution, equipment_risk)
|
||||
maintenance.graph_calibration = image
|
||||
maintenance.save()
|
||||
|
||||
@ -735,9 +768,21 @@ class MaintenanceLine(ModelSQL, ModelView):
|
||||
'Maintenance Line'
|
||||
__name__ = 'optical_equipment.maintenance.line'
|
||||
|
||||
line_replace = fields.Boolean("Replace", states={'readonly': If(Eval('line_maintenance_activity') == True, True)})
|
||||
line_maintenance_activity = fields.Boolean("Maintenance Activity", states={'readonly': If(Eval('line_replace') == True, True)})
|
||||
maintenance = fields.Many2One('optical_equipment.maintenance', 'Maintenance', ondelete='CASCADE', select=True)
|
||||
line_replace = fields.Boolean(
|
||||
"Replace",
|
||||
states={
|
||||
'readonly': If(
|
||||
Eval('line_maintenance_activity') == True,
|
||||
True)})
|
||||
line_maintenance_activity = fields.Boolean(
|
||||
"Maintenance Activity", states={
|
||||
'readonly': If(
|
||||
Eval('line_replace') == True, True)})
|
||||
maintenance = fields.Many2One(
|
||||
'optical_equipment.maintenance',
|
||||
'Maintenance',
|
||||
ondelete='CASCADE',
|
||||
select=True)
|
||||
replacement = fields.Many2One('product.product', 'Replacement', ondelete='RESTRICT',
|
||||
domain=[('replacement', '=', True)],
|
||||
states={'invisible': (If(Eval('line_maintenance_activity') == True, True)) | (If(Eval('line_replace') == False, True)),
|
||||
@ -759,7 +804,7 @@ class MaintenanceLine(ModelSQL, ModelView):
|
||||
unit = fields.Many2One('product.uom', 'Unit', ondelete='RESTRICT',
|
||||
states={
|
||||
'readonly': Eval('_parent_maintenance.state') != 'draft',
|
||||
},domain=[If(Bool(Eval('product_uom_category')),
|
||||
}, domain=[If(Bool(Eval('product_uom_category')),
|
||||
('category', '=', Eval('product_uom_category')),
|
||||
('category', '!=', -1)),
|
||||
])
|
||||
@ -768,7 +813,11 @@ class MaintenanceLine(ModelSQL, ModelView):
|
||||
description = fields.Text("Description", states={
|
||||
'readonly': Eval('_parent_maintenance.state') != 'draft',
|
||||
})
|
||||
company = fields.Function(fields.Many2One('company.company', "Company"),'on_change_with_company')
|
||||
company = fields.Function(
|
||||
fields.Many2One(
|
||||
'company.company',
|
||||
"Company"),
|
||||
'on_change_with_company')
|
||||
|
||||
@fields.depends('maintenance', '_parent_maintenance.company')
|
||||
def on_change_with_company(self, name=None):
|
||||
@ -844,7 +893,7 @@ class NewPropietaryMaintenance(Wizard):
|
||||
__name__ = 'optical_equipment.change_propietary_maintenance'
|
||||
|
||||
start = StateView('optical_equipment.change_propietary_maintenance.form',
|
||||
'optical_equipment.change_propietary_maintenance_view_form',[
|
||||
'optical_equipment.change_propietary_maintenance_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Create', 'change_propietary', 'tryton-ok', default=True),
|
||||
])
|
||||
|
@ -12,6 +12,7 @@ depends:
|
||||
purchase
|
||||
sale
|
||||
xml:
|
||||
company.xml
|
||||
equipment.xml
|
||||
calibration.xml
|
||||
contract.xml
|
||||
|
@ -20,7 +20,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="sale_quote_number"/>
|
||||
<field name="sale_quote_number"/>
|
||||
<newline/>
|
||||
<separator id="separator_configuraton" colspan="4"/>
|
||||
|
||||
<separator id="environmental_conditions" string="Environmental Conditions" colspan="4"/>
|
||||
<newline/>
|
||||
<label name="temperature_min"/>
|
||||
@ -41,4 +41,11 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="moisture_uom"/>
|
||||
<field name="moisture_uom"/>
|
||||
<newline/>
|
||||
|
||||
<separator id="technician_responsible" string="Technician Responsible" colspan="4"/>
|
||||
<label name="technician_responsible"/>
|
||||
<field name="technician_responsible"/>
|
||||
|
||||
<label name="invima"/>
|
||||
<field name="invima"/>
|
||||
</form>
|
||||
|
10
view/employee_form.xml
Normal file
10
view/employee_form.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//field[@name='supervisor']" position="after">
|
||||
<label name="invima"/>
|
||||
<field name="invima"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
@ -73,6 +73,12 @@
|
||||
</page>
|
||||
</notebook>
|
||||
<newline/>
|
||||
<label name="technician_responsible"/>
|
||||
<field name="technician_responsible"/>
|
||||
|
||||
<label name="invima"/>
|
||||
<field name="invima"/>
|
||||
|
||||
<label name="state"/>
|
||||
<field name="state"/>
|
||||
<group id="button">
|
||||
|
Loading…
Reference in New Issue
Block a user