lims: add related access to pending samples entries

This commit is contained in:
Adrián Bernardi 2020-06-16 20:55:56 -03:00
parent a60cb783ba
commit 96fa0cb596
4 changed files with 44 additions and 6 deletions

View file

@ -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,

View file

@ -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"

View file

@ -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'

View file

@ -303,6 +303,18 @@
<field name="action" ref="wiz_notebook_generate_results_report"/>
</record>
<!-- Wizard Open Sample Entry -->
<record model="ir.action.wizard" id="wiz_notebook_open_entry">
<field name="name">Sample Entry</field>
<field name="wiz_name">lims.notebook.open_entry</field>
</record>
<record model="ir.action.keyword" id="wiz_notebook_open_entry_keyword">
<field name="keyword">form_relate</field>
<field name="model">lims.notebook,-2</field>
<field name="action" ref="wiz_notebook_open_entry"/>
</record>
<!-- Wizard Generate Results Reports -->
<record model="ir.ui.view" id="lims_generate_results_report_start_view_form">