Se añade tecnico responsable
This commit is contained in:
		| @@ -1,14 +1,16 @@ | |||||||
| # This file is part of Tryton.  The COPYRIGHT file at the top level of | # This file is part of Tryton.  The COPYRIGHT file at the top level of | ||||||
| # this repository contains the full copyright notices and license terms. | # this repository contains the full copyright notices and license terms. | ||||||
| from trytond.pool import Pool | from trytond.pool import Pool | ||||||
| from . import (agended, balance_sale_party, calibration, configuration, contract, diary, | from . import (agended, balance_sale_party, calibration, configuration, | ||||||
|                equipment, party, product, maintenance, move, purchase, sale) |                contract, company, diary, equipment, party, product, | ||||||
|  |                maintenance, move, purchase, sale) | ||||||
|  |  | ||||||
| __all__ = ['register'] | __all__ = ['register'] | ||||||
|  |  | ||||||
|  |  | ||||||
| def register(): | def register(): | ||||||
|     Pool.register( |     Pool.register( | ||||||
|  |         company.Emplyee, | ||||||
|         equipment.OpticalEquipment, |         equipment.OpticalEquipment, | ||||||
|         equipment.EquipmentMaintenance, |         equipment.EquipmentMaintenance, | ||||||
|         equipment.EquipmentContract, |         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 ( | from trytond.model import ( | ||||||
|     ModelSingleton, ModelSQL, ModelView, fields) |     ModelSingleton, ModelSQL, ModelView, fields) | ||||||
| from trytond.pyson import Id | from trytond.pyson import Id, Eval | ||||||
| from trytond.modules.company.model import ( |  | ||||||
|     CompanyMultiValueMixin, CompanyValueMixin) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Configuration(ModelSingleton, ModelSQL, ModelView, CompanyMultiValueMixin): | class Configuration(ModelSingleton, ModelSQL, ModelView): | ||||||
|     'Equipment Configuration' |     'Equipment Configuration' | ||||||
|     __name__ = 'optical_equipment.configuration' |     __name__ = 'optical_equipment.configuration' | ||||||
|  |  | ||||||
|     equipment_sequence = fields.Many2One('ir.sequence', "Equipment Sequence", |     technician_responsible = fields.Many2One( | ||||||
|                         domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_equipment'))]) |         'company.employee', "Technician Responsible") | ||||||
|     maintenance_sequence = fields.Many2One('ir.sequence', "Maintenance Sequence", |     invima = fields.Char('Invima', states={ | ||||||
|                         domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_maintenances'))]) |         'required': Eval('technician_responsible', True) | ||||||
|     agended_sequence = fields.Many2One('ir.sequence', "Agended Sequence", |     }) | ||||||
|                         domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_agended'))]) |     equipment_sequence = fields.Many2One( | ||||||
|     contract_sequence = fields.Many2One('ir.sequence', "Contract Sequence", |         'ir.sequence', "Equipment Sequence", domain=[ | ||||||
|                         domain=[('sequence_type', '=', Id('optical_equipment', 'sequence_type_contract'))]) |             ('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_min = fields.Float("Temp Min") | ||||||
|     temperature_max = fields.Float("Temp Max") |     temperature_max = fields.Float("Temp Max") | ||||||
|     temperature_uom = fields.Many2One('product.uom', 'Temperature UOM', |     temperature_uom = fields.Many2One( | ||||||
|                     domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))], |         'product.uom', 'Temperature UOM', | ||||||
|  |         domain=[ | ||||||
|  |             ('category', '=', Id( | ||||||
|  |                 'optical_equipment', "uom_cat_temperature"))], | ||||||
|         depends={'itemperature_min'}) |         depends={'itemperature_min'}) | ||||||
|     moisture_min = fields.Float("Moisture Min") |     moisture_min = fields.Float("Moisture Min") | ||||||
|     moisture_max = fields.Float("Moisture Max") |     moisture_max = fields.Float("Moisture Max") | ||||||
|     moisture_uom = fields.Many2One('product.uom', "Moisture UOM", |     moisture_uom = fields.Many2One( | ||||||
|                     domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))], |         'product.uom', "Moisture UOM", | ||||||
|  |         domain=[ | ||||||
|  |             ('category', '=', Id( | ||||||
|  |                 'optical_equipment', 'uom_cat_relative_humedity'))], | ||||||
|         depends={'moisture_min'}) |         depends={'moisture_min'}) | ||||||
|     sale_quote_number = fields.Many2One('ir.sequence', "Sale Quote Number", |     sale_quote_number = fields.Many2One('ir.sequence', "Sale Quote Number", | ||||||
|                                         domain=[ |                                         domain=[ | ||||||
|                                             ('sequence_type', '=', Id('sale','sequence_type_sale')) |                                             ('sequence_type', '=', Id( | ||||||
|  |                                                 'sale', 'sequence_type_sale')) | ||||||
|                                         ]) |                                         ]) | ||||||
|   | |||||||
							
								
								
									
										111
									
								
								maintenance.py
									
									
									
									
									
								
							
							
						
						
									
										111
									
								
								maintenance.py
									
									
									
									
									
								
							| @@ -83,8 +83,10 @@ class MaintenanceService(Workflow, ModelSQL, ModelView): | |||||||
|         'readonly': If(Eval('state') == 'finished', True), |         'readonly': If(Eval('state') == 'finished', True), | ||||||
|         'required': If(Eval('state') == 'in_progress', True)}) |         'required': If(Eval('state') == 'in_progress', True)}) | ||||||
|     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=[ | ||||||
|                     states={'invisible': If(Eval('temperature_min') == None, True), |                                           ('category', '=', Id( | ||||||
|  |                                               'optical_equipment', "uom_cat_temperature"))], | ||||||
|  |                                       states={'invisible': If(Eval('temperature_min') is None, True), | ||||||
|                                               'readonly': (Eval('state') == 'finished'), |                                               'readonly': (Eval('state') == 'finished'), | ||||||
|                                               'required': If(Eval('state') == 'in_progress', True)},) |                                               'required': If(Eval('state') == 'in_progress', True)},) | ||||||
|     moisture_min = fields.Float("Moisture Min", states={ |     moisture_min = fields.Float("Moisture Min", states={ | ||||||
| @@ -94,8 +96,10 @@ class MaintenanceService(Workflow, ModelSQL, ModelView): | |||||||
|         'readonly': If(Eval('state') == 'finished', True), |         'readonly': If(Eval('state') == 'finished', True), | ||||||
|         'required': If(Eval('state') == 'in_progress', True)}) |         'required': If(Eval('state') == 'in_progress', True)}) | ||||||
|     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=[ | ||||||
|                                    states={'invisible' : If(Eval('moisture_min') == None, True), |                                        ('category', '=', Id( | ||||||
|  |                                            'optical_equipment', 'uom_cat_relative_humedity'))], | ||||||
|  |                                    states={'invisible': If(Eval('moisture_min') is None, True), | ||||||
|                                            'readonly': Eval('state') == 'finished', |                                            'readonly': Eval('state') == 'finished', | ||||||
|                                            'required': If(Eval('state') == 'in_progress', True)},) |                                            'required': If(Eval('state') == 'in_progress', True)},) | ||||||
|  |  | ||||||
| @@ -234,7 +238,7 @@ class MaintenanceService(Workflow, ModelSQL, ModelView): | |||||||
|         pool = Pool() |         pool = Pool() | ||||||
|         Config = pool.get('optical_equipment.configuration') |         Config = pool.get('optical_equipment.configuration') | ||||||
|         config = Config(2) |         config = Config(2) | ||||||
|         if config.maintenance_sequence != None: |         if config.maintenance_sequence is not None: | ||||||
|             if not maintenance.code: |             if not maintenance.code: | ||||||
|                 try: |                 try: | ||||||
|                     maintenance.code = config.maintenance_sequence.get() |                     maintenance.code = config.maintenance_sequence.get() | ||||||
| @@ -314,38 +318,59 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|     clean_int_ext = fields.Boolean("Limpieza interior y exterior") |     clean_int_ext = fields.Boolean("Limpieza interior y exterior") | ||||||
|     clean_eyes = fields.Boolean("Limpieza de lentes y espejos") |     clean_eyes = fields.Boolean("Limpieza de lentes y espejos") | ||||||
|     check_calibration = fields.Boolean("Verificar Calibración") |     check_calibration = fields.Boolean("Verificar Calibración") | ||||||
|     maintenance_activity = fields.One2Many('optical_equipment_maintenance.activity', 'maintenance', "Maintenance Activitys") |     maintenance_activity = fields.One2Many( | ||||||
|  |         'optical_equipment_maintenance.activity', | ||||||
|  |         'maintenance', | ||||||
|  |         "Maintenance Activitys") | ||||||
|     # Calibration |     # Calibration | ||||||
|     patterns_equipments = fields.Char("K Pattern", states={'readonly': True},) |     patterns_equipments = fields.Char("K Pattern", states={'readonly': True},) | ||||||
|     lines_calibration = fields.One2Many('optical_equipment.maintenance.calibration_sample', 'maintenance', "Lines of Calibration", |     lines_calibration = fields.One2Many('optical_equipment.maintenance.calibration_sample', 'maintenance', "Lines of Calibration", | ||||||
|                                         states={'readonly': Eval('state') == 'finished'}) |                                         states={'readonly': Eval('state') == 'finished'}) | ||||||
|     calibration_total = fields.One2Many('optical_equipment.maintenance.calibration', 'maintenance', "Calibration Total", |     calibration_total = fields.One2Many('optical_equipment.maintenance.calibration', 'maintenance', "Calibration Total", | ||||||
|                                         states={'readonly': Eval('state') == 'finished'}) |                                         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') |     description_activity = fields.Char('Activity') | ||||||
|     next_maintenance = fields.Function(fields.Date('Next Maintenance'), 'get_next_maintenance') |     next_maintenance = fields.Function(fields.Date('Next Maintenance'), 'get_next_maintenance') | ||||||
|     temperature_min = fields.Float("Temp Min") |     temperature_min = fields.Float("Temp Min") | ||||||
|     temperature_max = fields.Float("Temp Max") |     temperature_max = fields.Float("Temp Max") | ||||||
|     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=[ | ||||||
|                     states={'invisible': If(Eval('temperature_min') == None, True), |                                           ('category', '=', Id( | ||||||
|  |                                               'optical_equipment', "uom_cat_temperature"))], | ||||||
|  |                                       states={'invisible': If(Eval('temperature_min') is None, True), | ||||||
|                                               'readonly': (Eval('state') == 'finished')},) |                                               'readonly': (Eval('state') == 'finished')},) | ||||||
|     moisture_min = fields.Float("Moisture Min") |     moisture_min = fields.Float("Moisture Min") | ||||||
|     moisture_max = fields.Float("Moisture Max") |     moisture_max = fields.Float("Moisture Max") | ||||||
|     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=[ | ||||||
|                     states={'invisible' : If(Eval('moisture_min') == None, True), |                                        ('category', '=', Id( | ||||||
|  |                                            'optical_equipment', 'uom_cat_relative_humedity'))], | ||||||
|  |                                    states={'invisible': If(Eval('moisture_min') is None, True), | ||||||
|                                            'readonly': Eval('state') == 'finished'},) |                                            'readonly': Eval('state') == 'finished'},) | ||||||
|     graph_calibration = fields.Binary('Graphs') |     graph_calibration = fields.Binary('Graphs') | ||||||
|     rec_name = fields.Function(fields.Char('rec_name'), 'get_rec_name') |     rec_name = fields.Function(fields.Char('rec_name'), 'get_rec_name') | ||||||
|  |  | ||||||
|     # @fields.depends('maintenance_type', 'code') |     technician_responsible = fields.Char('Technician Responsible') | ||||||
|     # def get_rec_name(self, name): |     invima = fields.Char('Invima') | ||||||
|     #     if self.maintenance_type and self.code: |  | ||||||
|     #         name = str(self.maintenance_type) + '@' + str(self.code) |     @classmethod | ||||||
|     #     else: |     def default_technician_responsible(cls): | ||||||
|     #         name = str(self.maintenance_type) + '@' + 'Borrador' |         pool = Pool() | ||||||
|     #     return name |         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 |     @classmethod | ||||||
|     def __setup__(cls): |     def __setup__(cls): | ||||||
| @@ -379,7 +404,6 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|             }) |             }) | ||||||
|         ] |         ] | ||||||
|  |  | ||||||
|  |  | ||||||
|     @staticmethod |     @staticmethod | ||||||
|     def default_company(): |     def default_company(): | ||||||
|         return Transaction().context.get('company') |         return Transaction().context.get('company') | ||||||
| @@ -533,7 +557,9 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|         """ |         """ | ||||||
|         Grados Efectivos de libertad |         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 |         return uncertain_eff | ||||||
|  |  | ||||||
| @@ -571,9 +597,9 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|         ls = 'dotted' |         ls = 'dotted' | ||||||
|         fig, ax1 = plt.subplots(nrows=1, ncols=1) |         fig, ax1 = plt.subplots(nrows=1, ncols=1) | ||||||
|  |  | ||||||
|         ## Límites del Eje Y |         # Límites del Eje Y | ||||||
|         ax1.set_ylim(bottom, top) |         ax1.set_ylim(bottom, top) | ||||||
|         ## Límites del Eje X |         # Límites del Eje X | ||||||
|         ax1.set_xlim((min(labels) - 1, max(labels) + 1)) |         ax1.set_xlim((min(labels) - 1, max(labels) + 1)) | ||||||
|  |  | ||||||
|         ax1.yaxis.grid(True) |         ax1.yaxis.grid(True) | ||||||
| @@ -669,16 +695,22 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|                     resolution = a_resolution |                     resolution = a_resolution | ||||||
|                     factor_a = maintenance.equipment.product.a_factor_resolution |                     factor_a = maintenance.equipment.product.a_factor_resolution | ||||||
|                     uncertain_b2_analog = (a_resolution) / (factor_a * mt.sqrt(3)) |                     uncertain_b2_analog = (a_resolution) / (factor_a * mt.sqrt(3)) | ||||||
|                     sum_uncertain_c = (uncertain_type_A**2) + (uncertain_b1**2) + (uncertain_b2_analog**2) |                     sum_uncertain_c = (uncertain_type_A**2) + \ | ||||||
|  |                         (uncertain_b1**2) + (uncertain_b2_analog**2) | ||||||
|                     uncertain_c = mt.sqrt(sum_uncertain_c) |                     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": |                 elif maintenance.equipment.product.resolution_type == "digital": | ||||||
|                     d_resolution = maintenance.equipment.product.d_resolution |                     d_resolution = maintenance.equipment.product.d_resolution | ||||||
|                     resolution = d_resolution |                     resolution = d_resolution | ||||||
|                     uncertain_b2_digital = (d_resolution) / (2 * mt.sqrt(3)) |                     uncertain_b2_digital = (d_resolution) / (2 * mt.sqrt(3)) | ||||||
|                     sum_uncertain_c = (uncertain_type_A**2) + (uncertain_b1**2) + (uncertain_b2_digital**2) |                     sum_uncertain_c = (uncertain_type_A**2) + \ | ||||||
|  |                         (uncertain_b1**2) + (uncertain_b2_digital**2) | ||||||
|                     uncertain_c = mt.sqrt(sum_uncertain_c) |                     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) |                 t_student = t.ppf(1 - 0.025, uncertain_eff) | ||||||
|                 uncertain_expanded = round((t_student * uncertain_c), 2) |                 uncertain_expanded = round((t_student * uncertain_c), 2) | ||||||
| @@ -726,7 +758,8 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView): | |||||||
|                 maintenance.save() |                 maintenance.save() | ||||||
|  |  | ||||||
|             equipment_risk = maintenance.equipment.product.risk |             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.graph_calibration = image | ||||||
|             maintenance.save() |             maintenance.save() | ||||||
|  |  | ||||||
| @@ -735,9 +768,21 @@ class MaintenanceLine(ModelSQL, ModelView): | |||||||
|     'Maintenance Line' |     'Maintenance Line' | ||||||
|     __name__ = 'optical_equipment.maintenance.line' |     __name__ = 'optical_equipment.maintenance.line' | ||||||
|  |  | ||||||
|     line_replace = fields.Boolean("Replace", states={'readonly': If(Eval('line_maintenance_activity') ==  True, True)}) |     line_replace = fields.Boolean( | ||||||
|     line_maintenance_activity = fields.Boolean("Maintenance Activity", states={'readonly': If(Eval('line_replace') ==  True, True)}) |         "Replace", | ||||||
|     maintenance = fields.Many2One('optical_equipment.maintenance', 'Maintenance', ondelete='CASCADE', select=True) |         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', |     replacement = fields.Many2One('product.product', 'Replacement', ondelete='RESTRICT', | ||||||
|                                   domain=[('replacement', '=', True)], |                                   domain=[('replacement', '=', True)], | ||||||
|                                   states={'invisible': (If(Eval('line_maintenance_activity') == True, True)) | (If(Eval('line_replace') == False, True)), |                                   states={'invisible': (If(Eval('line_maintenance_activity') == True, True)) | (If(Eval('line_replace') == False, True)), | ||||||
| @@ -768,7 +813,11 @@ class MaintenanceLine(ModelSQL, ModelView): | |||||||
|     description = fields.Text("Description", states={ |     description = fields.Text("Description", states={ | ||||||
|         'readonly': Eval('_parent_maintenance.state') != 'draft', |         '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') |     @fields.depends('maintenance', '_parent_maintenance.company') | ||||||
|     def on_change_with_company(self, name=None): |     def on_change_with_company(self, name=None): | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ depends: | |||||||
|     purchase |     purchase | ||||||
|     sale |     sale | ||||||
| xml: | xml: | ||||||
|  |    company.xml | ||||||
|    equipment.xml	 |    equipment.xml	 | ||||||
|    calibration.xml |    calibration.xml | ||||||
|    contract.xml |    contract.xml | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ this repository contains the full copyright notices and license terms. --> | |||||||
|     <label name="sale_quote_number"/> |     <label name="sale_quote_number"/> | ||||||
|     <field name="sale_quote_number"/> |     <field name="sale_quote_number"/> | ||||||
|     <newline/> |     <newline/> | ||||||
|     <separator id="separator_configuraton" colspan="4"/> |      | ||||||
|     <separator id="environmental_conditions" string="Environmental Conditions" colspan="4"/> |     <separator id="environmental_conditions" string="Environmental Conditions" colspan="4"/> | ||||||
|     <newline/> |     <newline/> | ||||||
|     <label name="temperature_min"/> |     <label name="temperature_min"/> | ||||||
| @@ -41,4 +41,11 @@ this repository contains the full copyright notices and license terms. --> | |||||||
|     <label name="moisture_uom"/> |     <label name="moisture_uom"/> | ||||||
|     <field name="moisture_uom"/> |     <field name="moisture_uom"/> | ||||||
|     <newline/> |     <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> | </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> | 	</page> | ||||||
|     </notebook> |     </notebook> | ||||||
|     <newline/> |     <newline/> | ||||||
|  |     <label name="technician_responsible"/> | ||||||
|  |     <field name="technician_responsible"/> | ||||||
|  |  | ||||||
|  |     <label name="invima"/> | ||||||
|  |     <field name="invima"/> | ||||||
|  |  | ||||||
|     <label name="state"/> |     <label name="state"/> | ||||||
|     <field name="state"/> |     <field name="state"/> | ||||||
|     <group id="button"> |     <group id="button"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user