add reports

This commit is contained in:
sinergia 2023-04-03 13:50:43 -05:00
parent 4a5f756dbe
commit 35c74076b5
6 changed files with 32 additions and 22 deletions

View File

@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from . import (agended, calibration, configuration, contract, diary,
equipment, party, product, maintenance, purchase, sale)
equipment, party, product, maintenance, move, purchase, sale)
__all__ = ['register']
@ -41,6 +41,10 @@ def register():
maintenance.MaintenanceLine,
maintenance.MaintenanceActivity,
maintenance.ChangePropietaryMaintenance,
move.Move,
move.ShipmentOut,
move.ShipmentInternal,
move.ShipmentOutReturn,
module='optical_equipment', type_='model')
Pool.register(
agended.AssingAgended,
@ -53,4 +57,6 @@ def register():
contract.ContractReport,
equipment.EquipmentReport,
maintenance.MaintenanceServiceReport,
move.PickingListDeliveryReport,
move.CapacitationReport,
module='optical_equipment', type_='report')

View File

@ -5,6 +5,7 @@ from trytond.model import (
from trytond.pyson import Bool, Eval, If, Id, Equal
from trytond.pool import Pool
from trytond.modules.company import CompanyReport
from trytond.transaction import Transaction
_digits = (16, 2)
_states = {'readonly': If(Eval('state') != 'draft', True)}

View File

@ -255,7 +255,7 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
'Equipment Maintenance Line'
__name__ = 'optical_equipment.maintenance'
_rec_name = 'rec_name'
#_rec_name = 'rec_name'
_states={'required': True,
'readonly': Eval('state').in_(['finished'])}
@ -317,7 +317,16 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
'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
@classmethod
def __setup__(cls):
super(MaintenanceServiceLine, cls).__setup__()
@ -350,15 +359,6 @@ class MaintenanceServiceLine(Workflow, ModelSQL, ModelView):
})
]
@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
@staticmethod
def default_company():

View File

@ -135,14 +135,15 @@ class Template(metaclass=PoolMeta):
warranty = fields.Integer("Warranty")
#### calibration parameters
use_pattern = fields.Many2One('optical_equipment.use_pattern', "Use Pattern", ondelete='RESTRICT',
use_pattern = fields.Selection([
('', ""),
('ojo_esquematico', "Ojo esquematico"),
('lente_prueba', "Lente de Prueba"),
('pesas_calibration', "Pesas de Calibración"),
('esferas_calibration', "Esferas de Calibración")], "Patrón Utilizado", states={'required': Eval('calibration', True)})
new_use_pattern = fields.Many2One('optical_equipment.use_pattern', "Use Pattern", ondelete='RESTRICT',
states={'required': Eval('calibration', True)})
#use_pattern = fields.Selection([
# ('', ""),
# ('ojo_esquematico', "Ojo esquematico"),
# ('lente_prueba', "Lente de Prueba"),
# ('pesas_calibration', "Pesas de Calibración"),
# ('esferas_calibration', "Esferas de Calibración")], "Patrón Utilizado", states={'required': Eval('calibration', True)})
measuring_range = fields.Selection([
('dioptria', "Dioptria"),
('mmhg', "mmHg")], "Rango de Medición")

View File

@ -19,8 +19,10 @@ xml:
agended.xml
configuration.xml
maintenance.xml
move.xml
party.xml
uom.xml
product.xml
purchase.xml
sale.xml
sale.xml
shipment.xml

View File

@ -63,8 +63,8 @@
<field name="patterns_equipments"/>
<newline/>
<group colspan="6" yexpand="1" id="lines_calibration">
<!-- <field name="lines_calibration"/> -->
<!-- <newline/> -->
<field name="lines_calibration"/>
<newline/>
<field name="calibration_total"/>
</group>
</page>