From dd475803b08629786afeeb5f3b3e3cf75352b46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Tue, 18 Oct 2022 11:18:44 +0200 Subject: [PATCH] Fix partitions not displaying complete list of Interpretation Templates --- CHANGES.rst | 1 + .../core/browser/viewlets/resultsinterpretation.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index eeb0cc3540..0ed708b41d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changelog 2.4.0 (unreleased) ------------------ +- #2166 Fix partitions not displaying complete list of Interpretation Templates - #2165 Add DX phone field and widget - #2164 Added `IRetracted` and `IRejected` marker interfaces for analyses - #2162 Allow to create samples without analyses diff --git a/src/senaite/core/browser/viewlets/resultsinterpretation.py b/src/senaite/core/browser/viewlets/resultsinterpretation.py index a2a909eec3..34d6eceecd 100644 --- a/src/senaite/core/browser/viewlets/resultsinterpretation.py +++ b/src/senaite/core/browser/viewlets/resultsinterpretation.py @@ -82,15 +82,14 @@ def is_suitable(obj): """ obj = api.get_object(obj) sample_types = obj.getRawSampleTypes() or [sample_type_uid] - if sample_type_uid not in sample_types: - return False + if sample_type_uid in sample_types: + return True analysis_templates = obj.getRawAnalysisTemplates() - if analysis_templates: - if template_uid not in analysis_templates: - return False + if template_uid in analysis_templates: + return True - return True + return False def get_data_info(item): return {