mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims, lims_instrument: add field "Trace report" to Notebook lines and
Results reports
This commit is contained in:
parent
150f583caa
commit
dc2a5b406b
|
@ -3119,6 +3119,10 @@ msgctxt "field:lims.notebook.line,theoretical_concentration:"
|
||||||
msgid "Theoretical concentration"
|
msgid "Theoretical concentration"
|
||||||
msgstr "Concentración teórica"
|
msgstr "Concentración teórica"
|
||||||
|
|
||||||
|
msgctxt "field:lims.notebook.line,trace_report:"
|
||||||
|
msgid "Trace report"
|
||||||
|
msgstr "Traza"
|
||||||
|
|
||||||
msgctxt "field:lims.notebook.line,uncertainty:"
|
msgctxt "field:lims.notebook.line,uncertainty:"
|
||||||
msgid "Uncertainty"
|
msgid "Uncertainty"
|
||||||
msgstr "Incertidumbre"
|
msgstr "Incertidumbre"
|
||||||
|
@ -3411,6 +3415,10 @@ msgctxt "field:lims.notebook.line.all_fields,theoretical_concentration:"
|
||||||
msgid "Theoretical concentration"
|
msgid "Theoretical concentration"
|
||||||
msgstr "Concentración teórica"
|
msgstr "Concentración teórica"
|
||||||
|
|
||||||
|
msgctxt "field:lims.notebook.line.all_fields,trace_report:"
|
||||||
|
msgid "Trace report"
|
||||||
|
msgstr "Traza"
|
||||||
|
|
||||||
msgctxt "field:lims.notebook.line.all_fields,uncertainty:"
|
msgctxt "field:lims.notebook.line.all_fields,uncertainty:"
|
||||||
msgid "Uncertainty"
|
msgid "Uncertainty"
|
||||||
msgstr "Incertidumbre"
|
msgstr "Incertidumbre"
|
||||||
|
@ -5306,6 +5314,10 @@ msgctxt "field:lims.results_report.version.detail,state:"
|
||||||
msgid "State"
|
msgid "State"
|
||||||
msgstr "Estado"
|
msgstr "Estado"
|
||||||
|
|
||||||
|
msgctxt "field:lims.results_report.version.detail,trace_report:"
|
||||||
|
msgid "Trace report"
|
||||||
|
msgstr "Informar traza"
|
||||||
|
|
||||||
msgctxt "field:lims.results_report.version.detail,type:"
|
msgctxt "field:lims.results_report.version.detail,type:"
|
||||||
msgid "Type"
|
msgid "Type"
|
||||||
msgstr "Tipo"
|
msgstr "Tipo"
|
||||||
|
@ -5398,6 +5410,10 @@ msgctxt "field:lims.results_report.version.detail.line,start_date:"
|
||||||
msgid "Start date"
|
msgid "Start date"
|
||||||
msgstr "Fecha de inicio"
|
msgstr "Fecha de inicio"
|
||||||
|
|
||||||
|
msgctxt "field:lims.results_report.version.detail.line,trace_report:"
|
||||||
|
msgid "Trace report"
|
||||||
|
msgstr "Traza"
|
||||||
|
|
||||||
msgctxt "field:lims.results_report.version.detail.line,uncertainty:"
|
msgctxt "field:lims.results_report.version.detail.line,uncertainty:"
|
||||||
msgid "Uncertainty"
|
msgid "Uncertainty"
|
||||||
msgstr "Incertidumbre"
|
msgstr "Incertidumbre"
|
||||||
|
|
|
@ -1007,6 +1007,7 @@ class NotebookLine(ModelSQL, ModelView):
|
||||||
readonly=True)
|
readonly=True)
|
||||||
exceptional_load_uid = fields.Many2One('res.user',
|
exceptional_load_uid = fields.Many2One('res.user',
|
||||||
'Exceptional loading of results User', readonly=True)
|
'Exceptional loading of results User', readonly=True)
|
||||||
|
trace_report = fields.Boolean('Trace report')
|
||||||
|
|
||||||
del _states, _depends
|
del _states, _depends
|
||||||
|
|
||||||
|
@ -1812,6 +1813,7 @@ class NotebookLineAllFields(ModelSQL, ModelView):
|
||||||
readonly=True)
|
readonly=True)
|
||||||
exceptional_load_uid = fields.Many2One('res.user',
|
exceptional_load_uid = fields.Many2One('res.user',
|
||||||
'Exceptional loading of results User', readonly=True)
|
'Exceptional loading of results User', readonly=True)
|
||||||
|
trace_report = fields.Boolean('Trace report', readonly=True)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
@ -1913,6 +1915,7 @@ class NotebookLineAllFields(ModelSQL, ModelView):
|
||||||
line.repetition_reason,
|
line.repetition_reason,
|
||||||
line.exceptional_load,
|
line.exceptional_load,
|
||||||
line.exceptional_load_uid,
|
line.exceptional_load_uid,
|
||||||
|
line.trace_report,
|
||||||
]
|
]
|
||||||
where = Literal(True)
|
where = Literal(True)
|
||||||
return join6.select(*columns, where=where)
|
return join6.select(*columns, where=where)
|
||||||
|
|
|
@ -679,6 +679,7 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
'get_samples_list', searcher='search_samples_list')
|
'get_samples_list', searcher='search_samples_list')
|
||||||
entry_summary = fields.Function(fields.Char('Entry / Qty. Samples'),
|
entry_summary = fields.Function(fields.Char('Entry / Qty. Samples'),
|
||||||
'get_entry_summary', searcher='search_entry_summary')
|
'get_entry_summary', searcher='search_entry_summary')
|
||||||
|
trace_report = fields.Boolean('Trace report')
|
||||||
|
|
||||||
# State changes
|
# State changes
|
||||||
revision_uid = fields.Many2One('res.user', 'Revision user', readonly=True)
|
revision_uid = fields.Many2One('res.user', 'Revision user', readonly=True)
|
||||||
|
@ -1563,11 +1564,21 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_fields_from_samples(cls, samples, generate_report_form=None):
|
def _get_fields_from_samples(cls, samples, generate_report_form=None):
|
||||||
|
pool = Pool()
|
||||||
|
Notebook = pool.get('lims.notebook')
|
||||||
|
|
||||||
detail_default = {}
|
detail_default = {}
|
||||||
if len(samples) > 1:
|
if len(samples) > 1:
|
||||||
detail_default['report_type_forced'] = 'polisample'
|
detail_default['report_type_forced'] = 'polisample'
|
||||||
else:
|
else:
|
||||||
detail_default['report_type_forced'] = 'normal'
|
detail_default['report_type_forced'] = 'normal'
|
||||||
|
|
||||||
|
detail_default['trace_report'] = False
|
||||||
|
for sample in samples:
|
||||||
|
nb = Notebook(sample['notebook'])
|
||||||
|
if nb.fraction.sample.trace_report:
|
||||||
|
detail_default['trace_report'] = True
|
||||||
|
|
||||||
return detail_default
|
return detail_default
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -1909,6 +1920,8 @@ class ResultsReportVersionDetailLine(ModelSQL, ModelView):
|
||||||
reference = fields.Function(fields.Char('Reference'), 'get_reference')
|
reference = fields.Function(fields.Char('Reference'), 'get_reference')
|
||||||
comments = fields.Function(fields.Text('Entry comments'),
|
comments = fields.Function(fields.Text('Entry comments'),
|
||||||
'get_nline_field')
|
'get_nline_field')
|
||||||
|
trace_report = fields.Function(fields.Boolean('Trace report'),
|
||||||
|
'get_nline_field')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __register__(cls, module_name):
|
def __register__(cls, module_name):
|
||||||
|
@ -1965,6 +1978,10 @@ class ResultsReportVersionDetailLine(ModelSQL, ModelView):
|
||||||
result[name][d.id] = field.id if field else None
|
result[name][d.id] = field.id if field else None
|
||||||
else:
|
else:
|
||||||
result[name][d.id] = None
|
result[name][d.id] = None
|
||||||
|
elif cls._fields[name]._type == 'boolean':
|
||||||
|
for d in details:
|
||||||
|
result[name][d.id] = (d.notebook_line and
|
||||||
|
getattr(d.notebook_line, name, False) or False)
|
||||||
else:
|
else:
|
||||||
for d in details:
|
for d in details:
|
||||||
result[name][d.id] = (d.notebook_line and
|
result[name][d.id] = (d.notebook_line and
|
||||||
|
|
|
@ -128,4 +128,6 @@
|
||||||
</group>
|
</group>
|
||||||
<label name="exceptional_load_uid"/>
|
<label name="exceptional_load_uid"/>
|
||||||
<field name="exceptional_load_uid"/>
|
<field name="exceptional_load_uid"/>
|
||||||
|
<label name="trace_report"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -64,4 +64,5 @@
|
||||||
<field name="department"/>
|
<field name="department"/>
|
||||||
<field name="exceptional_load"/>
|
<field name="exceptional_load"/>
|
||||||
<field name="exceptional_load_uid"/>
|
<field name="exceptional_load_uid"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -135,4 +135,6 @@
|
||||||
</group>
|
</group>
|
||||||
<label name="exceptional_load_uid"/>
|
<label name="exceptional_load_uid"/>
|
||||||
<field name="exceptional_load_uid"/>
|
<field name="exceptional_load_uid"/>
|
||||||
|
<label name="trace_report"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -52,4 +52,5 @@
|
||||||
<field name="department"/>
|
<field name="department"/>
|
||||||
<field name="exceptional_load"/>
|
<field name="exceptional_load"/>
|
||||||
<field name="exceptional_load_uid"/>
|
<field name="exceptional_load_uid"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
<field name="signer"/>
|
<field name="signer"/>
|
||||||
<label name="resultrange_origin"/>
|
<label name="resultrange_origin"/>
|
||||||
<field name="resultrange_origin" widget="selection"/>
|
<field name="resultrange_origin" widget="selection"/>
|
||||||
|
<label name="trace_report"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page name="samples">
|
<page name="samples">
|
||||||
<field name="samples" colspan="4" mode="form,tree"
|
<field name="samples" colspan="4" mode="form,tree"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<field name="converted_result"/>
|
<field name="converted_result"/>
|
||||||
<field name="final_unit"/>
|
<field name="final_unit"/>
|
||||||
<field name="comments"/>
|
<field name="comments"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
<field name="corrected"/>
|
<field name="corrected"/>
|
||||||
<field name="hide"/>
|
<field name="hide"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<field name="signer"/>
|
<field name="signer"/>
|
||||||
<field name="cie_fraction_type"/>
|
<field name="cie_fraction_type"/>
|
||||||
<field name="resultrange_origin"/>
|
<field name="resultrange_origin"/>
|
||||||
|
<field name="trace_report"/>
|
||||||
<field name="create_date2" widget="date"/>
|
<field name="create_date2" widget="date"/>
|
||||||
<field name="create_date2" widget="time" string="Time"/>
|
<field name="create_date2" widget="time" string="Time"/>
|
||||||
<field name="write_date2" widget="date"/>
|
<field name="write_date2" widget="date"/>
|
||||||
|
|
|
@ -38,6 +38,10 @@ msgctxt "field:lims.notebook.line,imported_rm_correction_formula:"
|
||||||
msgid "Imported RM Correction Formula"
|
msgid "Imported RM Correction Formula"
|
||||||
msgstr "Fórmula Corrección RM importada"
|
msgstr "Fórmula Corrección RM importada"
|
||||||
|
|
||||||
|
msgctxt "field:lims.notebook.line,imported_trace_report:"
|
||||||
|
msgid "Imported Trace report"
|
||||||
|
msgstr "Traza importada"
|
||||||
|
|
||||||
msgctxt "field:lims.notebook.load_results_file.export,file:"
|
msgctxt "field:lims.notebook.load_results_file.export,file:"
|
||||||
msgid "File"
|
msgid "File"
|
||||||
msgstr "Archivo"
|
msgstr "Archivo"
|
||||||
|
|
|
@ -30,6 +30,7 @@ class NotebookLine(metaclass=PoolMeta):
|
||||||
imported_rm_correction_formula = fields.Char(
|
imported_rm_correction_formula = fields.Char(
|
||||||
'Imported RM Correction Formula')
|
'Imported RM Correction Formula')
|
||||||
imported_inj_date = fields.Date('Imported Inject date')
|
imported_inj_date = fields.Date('Imported Inject date')
|
||||||
|
imported_trace_report = fields.Boolean('Imported Trace report')
|
||||||
|
|
||||||
|
|
||||||
class BaseImport(object):
|
class BaseImport(object):
|
||||||
|
@ -398,6 +399,8 @@ class NotebookLoadResultsFile(Wizard):
|
||||||
if 'rm_correction_formula' in data:
|
if 'rm_correction_formula' in data:
|
||||||
res['imported_rm_correction_formula'] = (
|
res['imported_rm_correction_formula'] = (
|
||||||
data['rm_correction_formula'])
|
data['rm_correction_formula'])
|
||||||
|
if 'trace_report' in data:
|
||||||
|
res['imported_trace_report'] = data['trace_report']
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def default_result(self, fields):
|
def default_result(self, fields):
|
||||||
|
@ -532,6 +535,8 @@ class NotebookLoadResultsFile(Wizard):
|
||||||
values.append(line.imported_dilution_factor)
|
values.append(line.imported_dilution_factor)
|
||||||
columns.append(sql_table.rm_correction_formula)
|
columns.append(sql_table.rm_correction_formula)
|
||||||
values.append(line.imported_rm_correction_formula)
|
values.append(line.imported_rm_correction_formula)
|
||||||
|
columns.append(sql_table.trace_report)
|
||||||
|
values.append(line.imported_trace_report)
|
||||||
|
|
||||||
line_previous_professionals = []
|
line_previous_professionals = []
|
||||||
if line.imported_professionals:
|
if line.imported_professionals:
|
||||||
|
@ -594,6 +599,8 @@ class NotebookLoadResultsFile(Wizard):
|
||||||
values.append(Null)
|
values.append(Null)
|
||||||
columns.append(sql_table.imported_inj_date)
|
columns.append(sql_table.imported_inj_date)
|
||||||
values.append(Null)
|
values.append(Null)
|
||||||
|
columns.append(sql_table.imported_trace_report)
|
||||||
|
values.append(Literal(False))
|
||||||
# Write Results to Notebook lines
|
# Write Results to Notebook lines
|
||||||
cursor.execute(*sql_table.update(
|
cursor.execute(*sql_table.update(
|
||||||
columns, values,
|
columns, values,
|
||||||
|
@ -623,6 +630,7 @@ class NotebookLoadResultsFile(Wizard):
|
||||||
'imported_dilution_factor': None,
|
'imported_dilution_factor': None,
|
||||||
'imported_rm_correction_formula': None,
|
'imported_rm_correction_formula': None,
|
||||||
'imported_inj_date': None,
|
'imported_inj_date': None,
|
||||||
|
'imported_trace_report': False,
|
||||||
}
|
}
|
||||||
NotebookLine.write(
|
NotebookLine.write(
|
||||||
list(self.result.result_lines), notebook_line_clean)
|
list(self.result.result_lines), notebook_line_clean)
|
||||||
|
|
|
@ -13,4 +13,5 @@
|
||||||
<field name="imported_rm_correction_formula"/>
|
<field name="imported_rm_correction_formula"/>
|
||||||
<field name="imported_literal_result"/>
|
<field name="imported_literal_result"/>
|
||||||
<field name="imported_inj_date"/>
|
<field name="imported_inj_date"/>
|
||||||
|
<field name="imported_trace_report"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
Loading…
Reference in a new issue