6.4 #101

Merged
Rodia merged 54 commits from 6.4 into master 2023-07-29 21:13:59 -05:00
6 changed files with 32 additions and 22 deletions
Showing only changes of commit 35c74076b5 - Show all commits

View File

@ -2,7 +2,7 @@
# 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, calibration, configuration, contract, diary, from . import (agended, calibration, configuration, contract, diary,
equipment, party, product, maintenance, purchase, sale) equipment, party, product, maintenance, move, purchase, sale)
__all__ = ['register'] __all__ = ['register']
@ -41,6 +41,10 @@ def register():
maintenance.MaintenanceLine, maintenance.MaintenanceLine,
maintenance.MaintenanceActivity, maintenance.MaintenanceActivity,
maintenance.ChangePropietaryMaintenance, maintenance.ChangePropietaryMaintenance,
move.Move,
move.ShipmentOut,
move.ShipmentInternal,
move.ShipmentOutReturn,
module='optical_equipment', type_='model') module='optical_equipment', type_='model')
Pool.register( Pool.register(
agended.AssingAgended, agended.AssingAgended,
@ -53,4 +57,6 @@ def register():
contract.ContractReport, contract.ContractReport,
equipment.EquipmentReport, equipment.EquipmentReport,
maintenance.MaintenanceServiceReport, maintenance.MaintenanceServiceReport,
move.PickingListDeliveryReport,
move.CapacitationReport,
module='optical_equipment', type_='report') 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.pyson import Bool, Eval, If, Id, Equal
from trytond.pool import Pool from trytond.pool import Pool
from trytond.modules.company import CompanyReport from trytond.modules.company import CompanyReport
from trytond.transaction import Transaction
_digits = (16, 2) _digits = (16, 2)
_states = {'readonly': If(Eval('state') != 'draft', True)} _states = {'readonly': If(Eval('state') != 'draft', True)}

View File

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

View File

@ -135,14 +135,15 @@ class Template(metaclass=PoolMeta):
warranty = fields.Integer("Warranty") warranty = fields.Integer("Warranty")
#### calibration parameters #### 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)}) 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([ measuring_range = fields.Selection([
('dioptria', "Dioptria"), ('dioptria', "Dioptria"),
('mmhg', "mmHg")], "Rango de Medición") ('mmhg', "mmHg")], "Rango de Medición")

View File

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

View File

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