lims/lims_instrument: add result modifier 'Detected'

This commit is contained in:
Adri?n Bernardi 2019-12-27 09:22:25 -03:00
parent 9f745b3485
commit b2881c4197
5 changed files with 57 additions and 7 deletions

View File

@ -370,6 +370,10 @@ msgctxt "model:ir.message,text:msg_abs"
msgid "Absence"
msgstr "Ausencia"
msgctxt "model:ir.message,text:msg_d"
msgid "Detected"
msgstr "Detectado"
msgctxt "model:ir.message,text:msg_obs_rm_c_f"
msgid "Elements results are reported without recovery correction."
msgstr ""
@ -10258,6 +10262,11 @@ msgctxt ""
msgid "Absence"
msgstr "Ausencia"
msgctxt ""
"selection:lims.notebook.internal_relations_calc_2.variable,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt ""
"selection:lims.notebook.internal_relations_calc_2.variable,result_modifier:"
msgid "Negative"
@ -10324,6 +10333,10 @@ msgctxt "selection:lims.notebook.line,result_modifier:"
msgid "Absence"
msgstr "Ausencia"
msgctxt "selection:lims.notebook.line,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt "selection:lims.notebook.line,result_modifier:"
msgid "Negative"
msgstr "Negativo"
@ -10384,6 +10397,10 @@ msgctxt "selection:lims.notebook.line.all_fields,result_modifier:"
msgid "Absence"
msgstr "Ausencia"
msgctxt "selection:lims.notebook.line.all_fields,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt "selection:lims.notebook.line.all_fields,result_modifier:"
msgid "Negative"
msgstr "Negativo"
@ -10420,6 +10437,10 @@ msgctxt "selection:lims.notebook.load_results_formula.action,result_modifier:"
msgid "Absence"
msgstr "Ausencia"
msgctxt "selection:lims.notebook.load_results_formula.action,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt "selection:lims.notebook.load_results_formula.action,result_modifier:"
msgid "Negative"
msgstr "Negativo"
@ -10459,6 +10480,11 @@ msgctxt ""
msgid "Absence"
msgstr "Ausencia"
msgctxt ""
"selection:lims.notebook.load_results_formula.process,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt ""
"selection:lims.notebook.load_results_formula.process,result_modifier:"
msgid "Negative"
@ -10501,6 +10527,10 @@ msgctxt "selection:lims.notebook.load_results_manual.line,result_modifier:"
msgid "Absence"
msgstr "Ausencia"
msgctxt "selection:lims.notebook.load_results_manual.line,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt "selection:lims.notebook.load_results_manual.line,result_modifier:"
msgid "Negative"
msgstr "Negativo"
@ -10660,6 +10690,10 @@ msgctxt "selection:lims.results_report.version.detail.line,result_modifier:"
msgid "Absence"
msgstr "Ausencia"
msgctxt "selection:lims.results_report.version.detail.line,result_modifier:"
msgid "Detected"
msgstr "Detectado"
msgctxt "selection:lims.results_report.version.detail.line,result_modifier:"
msgid "Negative"
msgstr "Negativo"

View File

@ -301,6 +301,9 @@
<record model="ir.message" id="msg_pos">
<field name="text">Positive</field>
</record>
<record model="ir.message" id="msg_d">
<field name="text">Detected</field>
</record>
<record model="ir.message" id="msg_nd">
<field name="text">Not detected</field>
</record>

View File

@ -298,6 +298,7 @@ class NotebookLine(ModelSQL, ModelView):
result_modifier = fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -720,9 +721,9 @@ class NotebookLine(ModelSQL, ModelView):
elif not (self.result or self.converted_result or
self.literal_result or
self.result_modifier in
('nd', 'pos', 'neg', 'ni', 'abs', 'pre') or
('d', 'nd', 'pos', 'neg', 'ni', 'abs', 'pre') or
self.converted_result_modifier in
('nd', 'pos', 'neg', 'ni', 'abs', 'pre')):
('d', 'nd', 'pos', 'neg', 'ni', 'abs', 'pre')):
self.accepted = False
self.not_accepted_message = gettext('lims.msg_not_accepted_4')
else:
@ -939,6 +940,7 @@ class NotebookLineAllFields(ModelSQL, ModelView):
result_modifier = fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -2000,6 +2002,7 @@ class NotebookInternalRelationsCalc2Variable(ModelSQL, ModelView):
result_modifier = fields.Function(fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -2488,6 +2491,7 @@ class NotebookLoadResultsFormulaAction(ModelSQL):
result_modifier = fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -2534,6 +2538,7 @@ class NotebookLoadResultsFormulaProcess(ModelView):
result_modifier = fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -3240,6 +3245,7 @@ class NotebookLoadResultsManualLine(ModelSQL, ModelView):
result_modifier = fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -3954,9 +3960,9 @@ class NotebookAcceptLines(Wizard):
if not (notebook_line.result or notebook_line.converted_result or
notebook_line.literal_result or
notebook_line.result_modifier in
('nd', 'pos', 'neg', 'ni', 'abs', 'pre') or
('d', 'nd', 'pos', 'neg', 'ni', 'abs', 'pre') or
notebook_line.converted_result_modifier in
('nd', 'pos', 'neg', 'ni', 'abs', 'pre')):
('d', 'nd', 'pos', 'neg', 'ni', 'abs', 'pre')):
continue
if (notebook_line.converted_result and
notebook_line.converted_result_modifier

View File

@ -855,6 +855,7 @@ class ResultsReportVersionDetailLine(ModelSQL, ModelView):
result_modifier = fields.Function(fields.Selection([
('eq', '='),
('low', '<'),
('d', 'Detected'),
('nd', 'nd'),
('na', 'na'),
('pos', 'Positive'),
@ -2810,6 +2811,8 @@ class ResultReport(Report):
elif result_modifier == 'low':
res = gettext('lims.msg_quantification_limit', loq=res)
obs_ql = True
elif result_modifier == 'd':
res = gettext('lims.msg_d')
elif result_modifier == 'nd':
res = gettext('lims.msg_nd')
elif result_modifier == 'ni':
@ -2838,6 +2841,8 @@ class ResultReport(Report):
res = res
elif result_modifier == 'low':
res = '< %s' % res
elif result_modifier == 'd':
res = gettext('lims.msg_d')
elif result_modifier == 'nd':
res = gettext('lims.msg_nd')
elif result_modifier == 'pos':
@ -2874,6 +2879,8 @@ class ResultReport(Report):
res = gettext('lims.msg_pre')
elif converted_result_modifier == 'abs':
res = gettext('lims.msg_abs')
elif converted_result_modifier == 'd':
res = gettext('lims.msg_d')
elif converted_result_modifier == 'nd':
res = gettext('lims.msg_nd')
else:

View File

@ -344,10 +344,10 @@ class NotebookLoadResultsFile(Wizard):
('result', 'in', [None, '']),
('converted_result', 'in', [None, '']),
('literal_result', 'in', [None, '']),
('result_modifier', 'not in', ['nd', 'pos', 'neg',
'ni', 'abs', 'pre', 'na']),
('result_modifier', 'not in', ['d', 'nd', 'pos',
'neg', 'ni', 'abs', 'pre', 'na']),
('converted_result_modifier', 'not in',
['nd', 'pos', 'neg', 'ni', 'abs', 'pre']),
['d', 'nd', 'pos', 'neg', 'ni', 'abs', 'pre']),
]
line = NotebookLine.search(clause)
if line: