Update sql constraints error messages and translations

This commit is contained in:
Sebastián Marró 2019-08-01 00:33:07 -03:00
parent caed220d3c
commit b465cae7de
27 changed files with 416 additions and 377 deletions

View File

@ -109,7 +109,7 @@ class Typification(ModelSQL, ModelView):
cls._sql_constraints += [
('product_matrix_analysis_method_uniq',
Unique(t, t.product_type, t.matrix, t.analysis, t.method),
'This typification already exists'),
'lims.msg_typification_unique_id'),
]
@staticmethod
@ -264,7 +264,7 @@ class Typification(ModelSQL, ModelView):
def check_limits(self):
if (self.detection_limit and
self.quantification_limit <= self.detection_limit):
raise UserError(gettext('lims.lims.msg_limits'))
raise UserError(gettext('lims.msg_limits'))
def check_default(self):
if self.by_default:
@ -636,7 +636,7 @@ class ProductType(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Product type code must be unique'),
'lims.msg_product_type_unique_id'),
]
@staticmethod
@ -676,7 +676,7 @@ class Matrix(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Matrix code must be unique'),
'lims.msg_matrix_unique_id'),
]
@staticmethod
@ -723,7 +723,7 @@ class ObjectiveDescription(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('product_matrix_uniq', Unique(t, t.product_type, t.matrix),
'This objective description already exists'),
'lims.msg_objective_description_unique_id'),
]
@ -890,7 +890,7 @@ class Analysis(Workflow, ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Analysis code must be unique'),
'lims.msg_analysis_code_unique_id'),
]
cls._transitions |= set((
('draft', 'active'),

View File

@ -152,7 +152,7 @@ class AnalysisFamily(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Analysis family code must be unique'),
'lims.msg_analysis_family_code_unique_id'),
]
def get_rec_name(self, name):
@ -189,7 +189,7 @@ class AnalysisFamilyCertificant(ModelSQL, ModelView):
cls._sql_constraints += [
('product_matrix_uniq',
Unique(t, t.family, t.product_type, t.matrix),
'This record already exists'),
'lims.msg_analysis_family_certificant_unique_id'),
]

View File

@ -695,7 +695,7 @@ class EntrySuspensionReason(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Suspension reason code must be unique'),
'lims.msg_suspension_reason_unique_id'),
]
@staticmethod

View File

@ -45,7 +45,7 @@ class Laboratory(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Laboratory code must be unique'),
'lims.msg_laboratory_code_unique_id'),
]
def get_rec_name(self, name):
@ -100,9 +100,9 @@ class LaboratoryProfessional(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Professional code must be unique'),
'lims.msg_professional_code_unique_id'),
('party_uniq', Unique(t, t.party),
'The party is already associated to a professional'),
'lims.msg_professional_party_unique_id'),
]
def get_rec_name(self, name):
@ -159,7 +159,7 @@ class LabMethod(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Method code must be unique'),
'lims.msg_method_code_unique_id'),
]
def get_rec_name(self, name):
@ -224,7 +224,7 @@ class LabMethodWaitingTime(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('method_party_uniq', Unique(t, t.method, t.party),
'Repeated record'),
'lims.msg_method_waiting_time_unique_id'),
]
@classmethod
@ -284,7 +284,7 @@ class LabDevice(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Device code must be unique'),
'lims.msg_device_code_unique_id'),
]
def get_rec_name(self, name):
@ -321,7 +321,7 @@ class LabDeviceType(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Device type code must be unique'),
'lims.msg_device_type_code_unique_id'),
]
def get_rec_name(self, name):

File diff suppressed because it is too large Load Diff

View File

@ -403,5 +403,80 @@
<record model="ir.message" id="msg_reference_fractions_discharge_reversion">
<field name="text">Fractions Discharge Reversion</field>
</record>
<record model="ir.message" id="msg_typification_unique_id">
<field name="text">This typification already exists</field>
</record>
<record model="ir.message" id="msg_product_type_unique_id">
<field name="text">Product type code must be unique</field>
</record>
<record model="ir.message" id="msg_matrix_unique_id">
<field name="text">Matrix code must be unique</field>
</record>
<record model="ir.message" id="msg_objective_description_unique_id">
<field name="text">This objective description already exists</field>
</record>
<record model="ir.message" id="msg_analysis_code_unique_id">
<field name="text">Analysis code must be unique</field>
</record>
<record model="ir.message" id="msg_analysis_family_code_unique_id">
<field name="text">Analysis family code must be unique</field>
</record>
<record model="ir.message" id="msg_analysis_family_certificant_unique_id">
<field name="text">This record already exists</field>
</record>
<record model="ir.message" id="msg_suspension_reason_unique_id">
<field name="text">Suspension reason code must be unique</field>
</record>
<record model="ir.message" id="msg_laboratory_code_unique_id">
<field name="text">Laboratory code must be unique</field>
</record>
<record model="ir.message" id="msg_professional_code_unique_id">
<field name="text">Professional code must be unique</field>
</record>
<record model="ir.message" id="msg_professional_party_unique_id">
<field name="text">The party is already associated to a professional</field>
</record>
<record model="ir.message" id="msg_method_code_unique_id">
<field name="text">Method code must be unique</field>
</record>
<record model="ir.message" id="msg_method_waiting_time_unique_id">
<field name="text">Repeated record</field>
</record>
<record model="ir.message" id="msg_device_code_unique_id">
<field name="text">Device code must be unique</field>
</record>
<record model="ir.message" id="msg_device_type_code_unique_id">
<field name="text">Device type code must be unique</field>
</record>
<record model="ir.message" id="msg_party_lims_user_unique_id">
<field name="text">This lims user is already assigned to a party</field>
</record>
<record model="ir.message" id="msg_planification_professional_unique_id">
<field name="text">Professionals cannot be repeated</field>
</record>
<record model="ir.message" id="msg_professional_method_unique_id">
<field name="text">The method already exists for this professional</field>
</record>
<record model="ir.message" id="msg_zone_code_unique_id">
<field name="text">Zone code must be unique</field>
</record>
<record model="ir.message" id="msg_variety_code_unique_id">
<field name="text">Variety code must be unique</field>
</record>
<record model="ir.message" id="msg_packaging_integrity_code_unique_id">
<field name="text">Packaging integrity code must be unique</field>
</record>
<record model="ir.message" id="msg_packaging_type_code_unique_id">
<field name="text">Packaging type code must be unique</field>
</record>
<record model="ir.message" id="msg_fraction_type_code_unique_id">
<field name="text">Fraction type code must be unique</field>
</record>
<record model="ir.message" id="msg_uom_symbol_unique_id">
<field name="text">UoM symbol must be unique</field>
</record>
<record model="ir.message" id="msg_concentration_level_code_unique_id">
<field name="text">Concentration level code must be unique</field>
</record>
</data>
</tryton>

View File

@ -34,7 +34,7 @@ class Party(metaclass=PoolMeta):
t = cls.__table__()
cls._sql_constraints += [
('lims_user_uniq', Unique(t, t.lims_user),
'This lims user is already assigned to a party')]
'lims.msg_party_lims_user_unique_id')]
@staticmethod
def default_email_report():

View File

@ -563,7 +563,7 @@ class PlanificationTechnician(ModelSQL, ModelView):
cls._sql_constraints += [
('planification_professional_uniq',
Unique(t, t.planification, t.laboratory_professional),
'Professionals cannot be repeated'),
'lims.msg_planification_professional_unique_id'),
]
def get_details(self, name=None):
@ -867,7 +867,7 @@ class LabProfessionalMethod(ModelSQL, ModelView):
cls._sql_constraints += [
('professional_method_type_uniq',
Unique(t, t.professional, t.method, t.type),
'The method already exists for this professional'),
'lims.msg_professional_method_unique_id'),
]
def get_determination(self, name=None):

View File

@ -53,7 +53,7 @@ class Zone(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Zone code must be unique'),
'lims.msg_zone_code_unique_id'),
]
def get_rec_name(self, name):
@ -90,7 +90,7 @@ class Variety(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Variety code must be unique'),
'lims.msg_variety_code_unique_id'),
]
def get_rec_name(self, name):
@ -135,7 +135,7 @@ class PackagingIntegrity(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Packaging integrity code must be unique'),
'lims.msg_packaging_integrity_code_unique_id'),
]
def get_rec_name(self, name):
@ -170,7 +170,7 @@ class PackagingType(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Packaging type code must be unique'),
'lims.msg_packaging_type_code_unique_id'),
]
def get_rec_name(self, name):
@ -216,7 +216,7 @@ class FractionType(ModelSQL, ModelView):
cls._order.insert(0, ('code', 'ASC'))
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Fraction type code must be unique'),
'lims.msg_fraction_type_code_unique_id'),
]
@staticmethod

View File

@ -23,7 +23,7 @@ class Uom(metaclass=PoolMeta):
t = cls.__table__()
cls._sql_constraints += [
('symbol_uniq', Unique(t, t.symbol),
'UoM symbol must be unique'),
'lims.msg_uom_symbol_unique_id'),
]
def get_rec_name(self, name):
@ -221,7 +221,7 @@ class ConcentrationLevel(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Concentration level code must be unique'),
'lims.msg_concentration_level_code_unique_id'),
]
def get_rec_name(self, name):

View File

@ -2,15 +2,15 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:account.invoice.line:"
msgid "You can not delete an invoice line related to a service (\"%s\")"
msgstr "No puede eliminar una línea de factura relacionada a un servicio (\"%s\")"
msgctxt "model:ir.message,text:msg_delete_service_invoice"
msgid "You can not delete an invoice line related to a service (\"%(service)s\")"
msgstr "No puede eliminar una línea de factura relacionada a un servicio (\"%(service)s\")"
msgctxt "error:account.invoice:"
msgctxt "model:ir.message,text:msg_not_invoice_contacts"
msgid "Invoice Contacts field must have a value"
msgstr "El campo Contactos de factura debe tener un valor"
msgctxt "error:lims.service:"
msgctxt "model:ir.message,text:msg_missing_account_revenue"
msgid ""
"Analysis product \"%(product)s\" in Service \"%(service)s\" misses an "
"\"account revenue\"."
@ -18,10 +18,6 @@ msgstr ""
"Al producto \"%(product)s\" del análisis del servicio \"%(service)s\" le "
"falta una \"cuenta de ingresos\"."
msgctxt "error:lims.service:"
msgid "You can not delete a service related to an invoice"
msgstr "No puede eliminar un servicio relacionado a una factura"
msgctxt "field:account.invoice,currency_rate:"
msgid "Currency rate"
msgstr "Cotización"

View File

@ -2,7 +2,7 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.results_report:"
msgctxt "model:ir.message,text:msg_polisample"
msgid "Polisample"
msgstr "Polimuestra"

View File

@ -2,35 +2,35 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.notebook.load_results_file:"
msgctxt "model:ir.message,text:msg_end_date"
msgid "End date cannot be empty"
msgstr "La Fecha de finalización no puede estar vacía"
msgctxt "error:lims.notebook.load_results_file:"
msgctxt "model:ir.message,text:msg_end_date_start_date"
msgid "End date cannot be lower than Start date"
msgstr "La Fecha de finalización no puede ser menor que la Fecha de inicio"
msgctxt "error:lims.notebook.load_results_file:"
msgctxt "model:ir.message,text:msg_inj_date_start_date"
msgid "Injection date cannot be lower than Start date"
msgstr "La Fecha de inyección no puede ser menor que la Fecha de inicio"
msgctxt "error:lims.notebook.load_results_file:"
msgctxt "model:ir.message,text:msg_inj_date_end_date"
msgid "Injection date cannot be upper than End date"
msgstr "La Fecha de inyección no puede ser mayor que la Fecha de finalización"
msgctxt "error:lims.notebook.load_results_file:"
msgid "Professional(s) with code %s not identified"
msgstr "Profesional(es) no identificado(s): %s"
msgctxt "model:ir.message,text:msg_professionals"
msgid "Professional(s) with code %(code)s not identified"
msgstr "Profesional(es) no identificado(s): %(code)s"
msgctxt "error:lims.resultsimport:"
msgid "No module for importer type \"%s\""
msgstr "No se ha definido un módulo para el importador \"%s\""
msgctxt "model:ir.message,text:msg_not_module"
msgid "No module for importer type \"%(module)s\""
msgstr "No se ha definido un módulo para el importador \"%(module)s\""
msgctxt "error:lims.resultsimport:"
msgid "The function \"%s\" is not implemented for this importer"
msgstr "La función \"%s\" no está implementada para este importador"
msgctxt "model:ir.message,text:msg_not_implemented"
msgid "The function \"%(function)s\" is not implemented for this importer"
msgstr "La función \"%(function)s\" no está implementada para este importador"
msgctxt "error:lims.resultsimport:"
msgctxt "model:ir.message,text:msg_results_importer_unique_id"
msgid "The results importer name must be unique"
msgstr "El importador de resultados debe ser único"

View File

@ -28,5 +28,8 @@
<record model="ir.message" id="msg_professionals">
<field name="text">Professional(s) with code %(code)s not identified</field>
</record>
<record model="ir.message" id="msg_results_importer_unique_id">
<field name="text">The results importer name must be unique</field>
</record>
</data>
</tryton>

View File

@ -57,7 +57,7 @@ class ResultsImport(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('name_uniq', Unique(t, t.name),
'The results importer name must be unique'),
'lims_instrument.msg_results_importer_unique_id'),
]
@fields.depends('name')

View File

@ -2,7 +2,7 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.family.equivalent:"
msgctxt "model:ir.message,text:msg_invalid_product_uom_category"
msgid ""
"The UoM's Category of each Product should be the same as the UoM's Category "
"of Family/Equivalent."
@ -10,7 +10,7 @@ msgstr ""
"La Categoría de UdM de cada Producto debe ser la misma que la Categoría de "
"UdM de la Familia/Equivalente."
msgctxt "error:production:"
msgctxt "model:ir.message,text:msg_quantity_multiple_required"
msgid "Quantity multiple of output bom required."
msgstr "La cantidad no es múltiplo de la cantidad de salida de la LdM"

View File

@ -2,7 +2,7 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.project:"
msgctxt "model:ir.message,text:msg_code_unique_id"
msgid "Project code must be unique"
msgstr "El código del proyecto debe ser único"

8
lims_project/message.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<tryton>
<data group="1">
<record model="ir.message" id="msg_code_unique_id">
<field name="text">Project code must be unique</field>
</record>
</data>
</tryton>

View File

@ -32,7 +32,7 @@ class Project(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'Project code must be unique'),
'lims_project.msg_code_unique_id'),
]
@staticmethod

View File

@ -4,3 +4,4 @@ depends:
lims
xml:
project.xml
message.xml

View File

@ -2,31 +2,31 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.project.stp_professional.position:"
msgctxt "model:ir.message,text:msg_position_code_unique_id"
msgid "Position code must be unique"
msgstr "El código de la posición debe ser único"
msgctxt "error:lims.project.stp_professional:"
msgctxt "model:ir.message,text:msg_existing_role_facility_director"
msgid "There is already a Facility director for this project"
msgstr "Ya existe un Director de Instalación para este proyecto"
msgctxt "error:lims.project.stp_professional:"
msgctxt "model:ir.message,text:msg_existing_role_quality_unit"
msgid "There is already a Quality unit for this project"
msgstr "Ya existe una Unidad de Calidad para este proyecto"
msgctxt "error:lims.project.stp_professional:"
msgctxt "model:ir.message,text:msg_existing_role_study_director"
msgid "There is already a Study director for this project"
msgstr "Ya existe un Directorio de estudio para este proyecto"
msgctxt "error:lims.project:"
msgctxt "model:ir.message,text:msg_not_glp"
msgid "Please, select a \"Study plan\" Project to print this report"
msgstr ""
"Por favor, seleccione un Proyecto Plan de estudio para imprimir este informe"
msgctxt "error:lims.project:"
msgid "There is no sequence for Study plan Projects for the work year \"%s\"."
msgctxt "model:ir.message,text:msg_no_project_study_plan_sequence"
msgid "There is no sequence for Study plan Projects for the work year \"%(work_year)s\"."
msgstr ""
"No hay una secuencia para Proyectos Plan de estudio para el año laboral «%s»"
"No hay una secuencia para Proyectos Plan de estudio para el año laboral «%(work_year)s»"
msgctxt "field:lims.configuration,sample_in_custody_sequence:"
msgid "Sample in Custody Sequence"
@ -3917,13 +3917,13 @@ msgctxt "report:lims.project.glp_report.05:"
msgid "File operations responsible Signature:"
msgstr "Firma Responsable Operaciones del archivo:"
msgctxt "error:lims.project:"
msgctxt "model:ir.message,text:msg_not_analytical_phase"
msgid "Please, select a \"Analytical Phase Project\" to print this report"
msgstr ""
"Por favor, seleccione un proyecto de 'Plan de Fase Analítica' para "
"imprimir este informe"
msgctxt "error:lims.project:"
msgctxt "model:ir.message,text:msg_not_study_plan"
msgid "Please, select a \"Study Plan Phase Project\" to print this report"
msgstr ""
"Por favor, seleccione un proyecto de fase 'Plan de Estudio' para "

View File

@ -22,5 +22,8 @@
<record model="ir.message" id="msg_existing_role_quality_unit">
<field name="text">There is already a Quality unit for this project</field>
</record>
<record model="ir.message" id="msg_position_code_unique_id">
<field name="text">Position code must be unique</field>
</record>
</data>
</tryton>

View File

@ -473,7 +473,8 @@ class ProjectProfessionalPosition(ModelSQL, ModelView):
super(ProjectProfessionalPosition, cls).__setup__()
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code), 'Position code must be unique'),
('code_uniq', Unique(t, t.code),
'lims_project_study_plan.msg_position_code_unique_id'),
]
def get_rec_name(self, name):

View File

@ -2,11 +2,11 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:lims.project:"
msgid "There is no sequence for TAS Projects for the work year \"%s\"."
msgstr "No existe una secuencia para Proyectos SAT para este año laboral \"%s\"."
msgctxt "model:ir.message,text:msg_no_project_tas_sequence"
msgid "There is no sequence for TAS Projects for the work year \"%(work_year)s\"."
msgstr "No existe una secuencia para Proyectos SAT para este año laboral \"%(work_year)s\"."
msgctxt "error:lims.tas.type:"
msgctxt "model:ir.message,text:msg_tas_type_code_unique_id"
msgid "TAS type code must be unique"
msgstr "El código del tipo de SAT debe ser único"

View File

@ -4,5 +4,8 @@
<record model="ir.message" id="msg_no_project_tas_sequence">
<field name="text">There is no sequence for TAS Projects for the work year "%(work_year)s".</field>
</record>
<record model="ir.message" id="msg_tas_type_code_unique_id">
<field name="text">TAS type code must be unique</field>
</record>
</data>
</tryton>

View File

@ -148,7 +148,7 @@ class TasType(ModelSQL, ModelView):
t = cls.__table__()
cls._sql_constraints += [
('code_uniq', Unique(t, t.code),
'TAS type code must be unique'),
'lims_project_tas.msg_tas_type_code_unique_id'),
]
def get_rec_name(self, name):

View File

@ -75,7 +75,7 @@ msgid "Water sampling"
msgstr "Muestreo"
##
msgctxt "error:lims.project:"
msgctxt "model:ir.message,text:msg_not_water"
msgid "Please, select a \"Water sampling\" Project to print this report"
msgstr "Por favor, seleccione un proyecto de muestreo para imprimir."