From b8c7fc3387efb9063b7838f7e6c7d7148f970c13 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Fri, 19 May 2017 10:26:33 +0200 Subject: [PATCH] Check if SammpleType is set This fixes #2052 --- bika/lims/content/sample.py | 7 ++++--- docs/CHANGELOG.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bika/lims/content/sample.py b/bika/lims/content/sample.py index 3a2c830e29..110094ee56 100644 --- a/bika/lims/content/sample.py +++ b/bika/lims/content/sample.py @@ -467,9 +467,10 @@ visible=False, ), ), - ComputedField('SampleTypeUID', - expression = 'context.getSampleType().UID()', - widget = ComputedWidget( + ComputedField( + 'SampleTypeUID', + expression='context.getSampleType() and context.getSampleType().UID() or None', + widget=ComputedWidget( visible=False, ), ), diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 45f87f76cf..aab442810c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -1,5 +1,6 @@ 3.2.1 (unreleased) ------------------ +Issue-2052: Computed Sample Field "SampleTypeUID" does not check if a SampleType is set Issue-2024: Worksheet Template table header in Layout not translated Issue-1973: Published PDF reports are visible by anonymous users Issue-1976: Publication Report "bydepartment" raises an Error