lims_instrument: "Load Results from File" wizard: bugfix
This commit is contained in:
parent
fc3b6c30a6
commit
430a72d8b0
|
@ -465,6 +465,7 @@ class NotebookLoadResultsFile(Wizard):
|
|||
NOW = datetime.now()
|
||||
warnings = False
|
||||
messages = ''
|
||||
export_results = self.start.results_importer.exportResults()
|
||||
|
||||
previous_professionals = []
|
||||
lines_to_update = []
|
||||
|
@ -525,6 +526,20 @@ class NotebookLoadResultsFile(Wizard):
|
|||
+ ' not identified')
|
||||
|
||||
if prevent_line:
|
||||
row_num = 0
|
||||
rawresults = self.start.results_importer.rawresults
|
||||
number = line.fraction.number
|
||||
if number in rawresults:
|
||||
code = line.analysis.code
|
||||
if code in rawresults[number]:
|
||||
rep = line.repetition
|
||||
if rep in rawresults[number][code]:
|
||||
row_num = rawresults[number][code][rep][
|
||||
'row_number']
|
||||
# Update rawresults
|
||||
if export_results:
|
||||
rawresults[number][code][rep]['outcome'] = (
|
||||
outcome)
|
||||
warnings = True
|
||||
messages += str(row_num) + ': ' + outcome + '\n'
|
||||
else:
|
||||
|
@ -540,20 +555,6 @@ class NotebookLoadResultsFile(Wizard):
|
|||
line.imported_inj_date = None
|
||||
lines_to_update.append(line)
|
||||
|
||||
# Update rawresults
|
||||
row_num = 0
|
||||
if self.start.results_importer.exportResults() or prevent_line:
|
||||
rawresults = self.start.results_importer.rawresults
|
||||
number = line.fraction.number
|
||||
if number in rawresults:
|
||||
code = line.analysis.code
|
||||
if code in rawresults[number]:
|
||||
rep = line.repetition
|
||||
if rep in rawresults[number][code]:
|
||||
rawresults[number][code][rep]['outcome'] = outcome
|
||||
row_num = rawresults[number][code][rep][
|
||||
'row_number']
|
||||
|
||||
# Write Results to Notebook lines
|
||||
AnalyticProfessional.delete(previous_professionals)
|
||||
NotebookLine.save(lines_to_update)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<form>
|
||||
<image name="tryton-dialog-warning" xexpand="0" xfill="0"/>
|
||||
<image name="tryton-warning" xexpand="0" xfill="0"/>
|
||||
<group col="1" id="labels">
|
||||
<label string="There are some issues with the imported data"
|
||||
id="explanation"
|
||||
yalign="0.0" xalign="0.0" xexpand="1"/>
|
||||
</group>
|
||||
<group colspan="4" id="messages">
|
||||
<field name="msg"/>
|
||||
<field name="msg" height="400"/>
|
||||
</group>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue