lims: do not use annulled reports as current

This commit is contained in:
Adrián Bernardi 2022-03-25 13:37:47 -03:00
parent 06c175f672
commit 55b9c3229e
1 changed files with 2 additions and 0 deletions

View File

@ -2330,6 +2330,7 @@ class GenerateReport(Wizard):
existing_details = ResultsDetail.search([
('laboratory', '=', laboratory_id),
('samples.notebook', '=', notebook.id),
('state', '!=', 'annulled'),
])
if existing_details:
existing_reports = [d.report_version.results_report.id
@ -2567,6 +2568,7 @@ class GenerateReport(Wizard):
existing_details = ResultsDetail.search([
('laboratory', '=', laboratory_id),
('samples.notebook', '=', samples[0]['notebook']),
('state', '!=', 'annulled'),
])
if existing_details:
current_reports = [d.report_version.results_report.id