lims, lims_diagnosis, lims_industry, lims_quality_control: notebook line: new
field to show formated result
This commit is contained in:
parent
8c360a7fab
commit
c99ac07f21
|
@ -2789,6 +2789,10 @@ msgctxt "field:lims.notebook.line,final_unit:"
|
||||||
msgid "Final unit"
|
msgid "Final unit"
|
||||||
msgstr "Unidad final"
|
msgstr "Unidad final"
|
||||||
|
|
||||||
|
msgctxt "field:lims.notebook.line,formated_result:"
|
||||||
|
msgid "Result to report"
|
||||||
|
msgstr "Resultado a informar"
|
||||||
|
|
||||||
msgctxt "field:lims.notebook.line,fraction:"
|
msgctxt "field:lims.notebook.line,fraction:"
|
||||||
msgid "Fraction"
|
msgid "Fraction"
|
||||||
msgstr "Fracción"
|
msgstr "Fracción"
|
||||||
|
@ -3097,6 +3101,10 @@ msgctxt "field:lims.notebook.line.all_fields,final_unit:"
|
||||||
msgid "Final unit"
|
msgid "Final unit"
|
||||||
msgstr "Unidad final"
|
msgstr "Unidad final"
|
||||||
|
|
||||||
|
msgctxt "field:lims.notebook.all_fields,formated_result:"
|
||||||
|
msgid "Result to report"
|
||||||
|
msgstr "Resultado a informar"
|
||||||
|
|
||||||
msgctxt "field:lims.notebook.line.all_fields,fraction:"
|
msgctxt "field:lims.notebook.line.all_fields,fraction:"
|
||||||
msgid "Fraction"
|
msgid "Fraction"
|
||||||
msgstr "Fracción"
|
msgstr "Fracción"
|
||||||
|
|
|
@ -883,6 +883,8 @@ class NotebookLine(ModelSQL, ModelView):
|
||||||
states=_states, depends=_depends)
|
states=_states, depends=_depends)
|
||||||
converted_result = fields.Char('Converted result',
|
converted_result = fields.Char('Converted result',
|
||||||
states=_states, depends=_depends)
|
states=_states, depends=_depends)
|
||||||
|
formated_result = fields.Function(fields.Char('Result to report'),
|
||||||
|
'get_formated_result')
|
||||||
detection_limit = fields.Char('Detection limit',
|
detection_limit = fields.Char('Detection limit',
|
||||||
states=_states, depends=_depends)
|
states=_states, depends=_depends)
|
||||||
quantification_limit = fields.Char('Quantification limit',
|
quantification_limit = fields.Char('Quantification limit',
|
||||||
|
@ -1582,7 +1584,7 @@ class NotebookLine(ModelSQL, ModelView):
|
||||||
return self.planification.comments
|
return self.planification.comments
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def get_formated_result(self):
|
def get_formated_result(self, name=None):
|
||||||
res = ''
|
res = ''
|
||||||
result_modifier = self.result_modifier
|
result_modifier = self.result_modifier
|
||||||
if self.literal_result:
|
if self.literal_result:
|
||||||
|
@ -1726,6 +1728,8 @@ class NotebookLineAllFields(ModelSQL, ModelView):
|
||||||
'converted_result_modifier')
|
'converted_result_modifier')
|
||||||
result = fields.Char('Result', readonly=True)
|
result = fields.Char('Result', readonly=True)
|
||||||
converted_result = fields.Char('Converted result', readonly=True)
|
converted_result = fields.Char('Converted result', readonly=True)
|
||||||
|
formated_result = fields.Function(fields.Char('Result to report'),
|
||||||
|
'get_line_field')
|
||||||
detection_limit = fields.Char('Detection limit', readonly=True)
|
detection_limit = fields.Char('Detection limit', readonly=True)
|
||||||
quantification_limit = fields.Char('Quantification limit', readonly=True)
|
quantification_limit = fields.Char('Quantification limit', readonly=True)
|
||||||
lower_limit = fields.Char('Lower limit allowed', readonly=True)
|
lower_limit = fields.Char('Lower limit allowed', readonly=True)
|
||||||
|
|
|
@ -1821,7 +1821,7 @@ class ResultsReportVersionDetailLine(ModelSQL, ModelView):
|
||||||
result = {}
|
result = {}
|
||||||
for d in details:
|
for d in details:
|
||||||
result[d.id] = (d.notebook_line and
|
result[d.id] = (d.notebook_line and
|
||||||
d.notebook_line.get_formated_result() or None)
|
d.notebook_line.formated_result or None)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<field name="converted_result_modifier"/>
|
<field name="converted_result_modifier"/>
|
||||||
<field name="result"/>
|
<field name="result"/>
|
||||||
<field name="converted_result"/>
|
<field name="converted_result"/>
|
||||||
|
<field name="formated_result"/>
|
||||||
<field name="detection_limit"/>
|
<field name="detection_limit"/>
|
||||||
<field name="quantification_limit"/>
|
<field name="quantification_limit"/>
|
||||||
<field name="lower_limit"/>
|
<field name="lower_limit"/>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<field name="converted_result_modifier"/>
|
<field name="converted_result_modifier"/>
|
||||||
<field name="result"/>
|
<field name="result"/>
|
||||||
<field name="converted_result"/>
|
<field name="converted_result"/>
|
||||||
|
<field name="formated_result"/>
|
||||||
<field name="detection_limit"/>
|
<field name="detection_limit"/>
|
||||||
<field name="quantification_limit"/>
|
<field name="quantification_limit"/>
|
||||||
<field name="lower_limit"/>
|
<field name="lower_limit"/>
|
||||||
|
|
|
@ -423,8 +423,7 @@ class SamplesComparatorLine(ModelSQL, ModelView):
|
||||||
result[name] = {}
|
result[name] = {}
|
||||||
if name == 'result':
|
if name == 'result':
|
||||||
for l in lines:
|
for l in lines:
|
||||||
result[name][l.id] = (
|
result[name][l.id] = l.notebook_line.formated_result
|
||||||
l.notebook_line.get_formated_result())
|
|
||||||
elif name == 'converted_result':
|
elif name == 'converted_result':
|
||||||
for l in lines:
|
for l in lines:
|
||||||
result[name][l.id] = (
|
result[name][l.id] = (
|
||||||
|
@ -462,7 +461,7 @@ class SamplesComparatorLine(ModelSQL, ModelView):
|
||||||
])
|
])
|
||||||
if not notebook_line:
|
if not notebook_line:
|
||||||
return None
|
return None
|
||||||
return notebook_line[0].get_formated_result()
|
return notebook_line[0].formated_result
|
||||||
|
|
||||||
|
|
||||||
class Cron(metaclass=PoolMeta):
|
class Cron(metaclass=PoolMeta):
|
||||||
|
|
|
@ -838,7 +838,7 @@ class ResultsReportVersionDetailLine(metaclass=PoolMeta):
|
||||||
])
|
])
|
||||||
if not precedent_line:
|
if not precedent_line:
|
||||||
return ''
|
return ''
|
||||||
return precedent_line[0].get_formated_result()
|
return precedent_line[0].formated_result
|
||||||
|
|
||||||
|
|
||||||
class OpenResultsDetailPrecedent(Wizard):
|
class OpenResultsDetailPrecedent(Wizard):
|
||||||
|
|
|
@ -262,7 +262,7 @@ class NotebookLine(metaclass=PoolMeta):
|
||||||
def get_test_result(cls, lines, name):
|
def get_test_result(cls, lines, name):
|
||||||
result = {}
|
result = {}
|
||||||
for line in lines:
|
for line in lines:
|
||||||
result[line.id] = line.get_formated_result()
|
result[line.id] = line.formated_result
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in New Issue