From 96fa0cb596b6804adfe6191ef53fd8e203028d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Bernardi?= Date: Tue, 16 Jun 2020 20:55:56 -0300 Subject: [PATCH] lims: add related access to pending samples entries --- lims/__init__.py | 1 + lims/locale/es.po | 4 ++++ lims/results_report.py | 33 +++++++++++++++++++++++++++------ lims/results_report.xml | 12 ++++++++++++ 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/lims/__init__.py b/lims/__init__.py index 4323075b..9be7b610 100644 --- a/lims/__init__.py +++ b/lims/__init__.py @@ -305,6 +305,7 @@ def register(): results_report.GenerateResultsReport, results_report.OpenSamplesPendingReporting, results_report.GenerateReport, + results_report.OpenSampleEntry, results_report.PrintResultsReport, certification.DuplicateAnalysisFamily, results_report.ServiceResultsReport, diff --git a/lims/locale/es.po b/lims/locale/es.po index 93bbecb7..45e92b2c 100644 --- a/lims/locale/es.po +++ b/lims/locale/es.po @@ -6689,6 +6689,10 @@ msgctxt "model:ir.action,name:wiz_notebook_line_evaluate_rules" msgid "Evaluate Rules" msgstr "10) Evaluar Reglas de cuaderno" +msgctxt "model:ir.action,name:wiz_notebook_open_entry" +msgid "Sample Entry" +msgstr "Ingreso de la Muestra" + msgctxt "model:ir.action,name:wiz_print_analysis_checked_pending_inform" msgid "Analysis checked pending of inform" msgstr "AnĂ¡lisis tildados pendientes de informar" diff --git a/lims/results_report.py b/lims/results_report.py index 03aec631..42d91bde 100644 --- a/lims/results_report.py +++ b/lims/results_report.py @@ -32,12 +32,12 @@ __all__ = ['ResultsReport', 'ResultsReportVersion', 'GenerateResultsReportResultAutExcludedNotebookLine', 'GenerateResultsReport', 'OpenSamplesPendingReportingStart', 'OpenSamplesPendingReporting', 'GenerateReportStart', 'GenerateReport', - 'PrintResultsReport', 'ServiceResultsReport', 'FractionResultsReport', - 'SampleResultsReport', 'OpenResultsReportSample', 'OpenResultsDetailEntry', - 'OpenResultsDetailAttachment', 'ResultsReportAnnulationStart', - 'ResultsReportAnnulation', 'NewResultsReportVersionStart', - 'NewResultsReportVersion', 'ResultReport', 'GlobalResultReport', - 'ResultReportTranscription'] + 'OpenSampleEntry', 'PrintResultsReport', 'ServiceResultsReport', + 'FractionResultsReport', 'SampleResultsReport', 'OpenResultsReportSample', + 'OpenResultsDetailEntry', 'OpenResultsDetailAttachment', + 'ResultsReportAnnulationStart', 'ResultsReportAnnulation', + 'NewResultsReportVersionStart', 'NewResultsReportVersion', 'ResultReport', + 'GlobalResultReport', 'ResultReportTranscription'] class ResultsReport(ModelSQL, ModelView): @@ -2703,6 +2703,27 @@ class GenerateReport(Wizard): return 'reload' +class OpenSampleEntry(Wizard): + 'Sample Entry' + __name__ = 'lims.notebook.open_entry' + + start = StateAction('lims.act_lims_entry_list') + + def do_start(self, action): + Notebook = Pool().get('lims.notebook') + + active_ids = Transaction().context['active_ids'] + notebooks = Notebook.browse(active_ids) + + entries_ids = [n.fraction.sample.entry.id for n in notebooks] + + action['pyson_domain'] = PYSONEncoder().encode([ + ('id', 'in', entries_ids), + ]) + action['name'] += ' (%s)' % ', '.join(n.rec_name for n in notebooks) + return action, {} + + class PrintResultsReport(Wizard): 'Print Results Report' __name__ = 'lims.print_results_report' diff --git a/lims/results_report.xml b/lims/results_report.xml index 08614b6c..65a69891 100644 --- a/lims/results_report.xml +++ b/lims/results_report.xml @@ -303,6 +303,18 @@ + + + + Sample Entry + lims.notebook.open_entry + + + form_relate + lims.notebook,-2 + + +