From 74ce992cd14f85f7f54321bd1dc99cefa90cec38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Bernardi?= Date: Thu, 20 Jul 2023 18:26:01 -0300 Subject: [PATCH] lims_email: results report name format: add sample_label as variable --- lims_email/locale/es.po | 2 ++ lims_email/results_report.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lims_email/locale/es.po b/lims_email/locale/es.po index b3c54893..521bf90a 100644 --- a/lims_email/locale/es.po +++ b/lims_email/locale/es.po @@ -121,11 +121,13 @@ msgid "" "Available variables (also in upper case):\n" "- ${number}\n" "- ${sample_number}\n" +"- ${sample_label}\n" "- ${party_name}" msgstr "" "Variables disponibles (también en mayúsculas):\n" "- ${number}\n" "- ${sample_number}\n" +"- ${sample_label}\n" "- ${party_name}" msgctxt "model:ir.action,name:act_results_report_format" diff --git a/lims_email/results_report.py b/lims_email/results_report.py index 422b5566..391c824d 100644 --- a/lims_email/results_report.py +++ b/lims_email/results_report.py @@ -299,6 +299,8 @@ class ResultsReport(metaclass=PoolMeta): 'number': getattr(self, 'number', None) or '', 'sample_number': (sample and sample.notebook.fraction.sample.number or ''), + 'sample_label': (sample and + sample.notebook.fraction.sample.label or ''), 'party_name': sample and sample.party.rec_name or '', } for key, value in list(substitutions.items()): @@ -801,6 +803,7 @@ class ReportNameFormat(ModelSQL, ModelView): help=("Available variables (also in upper case):" "\n- ${number}" "\n- ${sample_number}" + "\n- ${sample_label}" "\n- ${party_name}")) @classmethod