From 49aab0a5e7a02e7c37dd4c95e2e402abfb6f9e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Mon, 27 Jan 2020 17:46:27 +0100 Subject: [PATCH 1/2] Error when viewing a Sample w/o Batch as client contact Traceback (innermost last): Module ZPublisher.Publish, line 138, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 48, in call_object Module bika.lims.browser.analysisrequest.view, line 62, in __call__ Module bika.lims.browser.header_table, line 83, in __call__ Module Products.Five.browser.pagetemplatefile, line 125, in __call__ Module Products.Five.browser.pagetemplatefile, line 59, in __call__ Module zope.pagetemplate.pagetemplate, line 132, in pt_render Module five.pt.engine, line 98, in __call__ Module z3c.pt.pagetemplate, line 173, in render Module chameleon.zpt.template, line 306, in render Module chameleon.template, line 209, in render Module chameleon.template, line 187, in render Module 64a1bd307477a7bad19adec76209dda5.py, line 186, in render Module bika.lims.browser.header_table, line 274, in get_fields_grouped_by_location Module bika.lims.browser.header_table, line 260, in get_field_visibility_mode Module bika.lims.monkey.Widget, line 75, in isVisible Module bika.lims.adapters.widgetvisibility, line 44, in __call__ Module bika.lims.adapters.widgetvisibility, line 109, in isVisible AttributeError: 'NoneType' object has no attribute 'getClient' - Expression: "python:view.get_fields_grouped_by_location()" - Filename: ... senaite.core/bika/lims/browser/templates/header_table.pt - Location: (line 15: col 22) - Source: ... ine="dummy python:view.get_fields_grouped_by_location(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Arguments: repeat: {...} (0) template: views: modules: args: here: wrapped_repeat: user: nothing: container: request: traverse_subpath: default: context: view: translate: root: options: {...} (0) loop: {...} (0) target_language: en --- bika/lims/adapters/widgetvisibility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bika/lims/adapters/widgetvisibility.py b/bika/lims/adapters/widgetvisibility.py index 18c22a14c4..12d0602069 100644 --- a/bika/lims/adapters/widgetvisibility.py +++ b/bika/lims/adapters/widgetvisibility.py @@ -106,7 +106,7 @@ def isVisible(self, field, mode="view", default="visible"): # is assigned to does not have a client assigned (e.g., the # batch was assigned by lab personnel), hide this field batch = self.context.getBatch() - if batch.getClient() != client: + if batch and batch.getClient() != client: return "invisible" return default From 6c23878e7a8cb14203975c12db74bfcf1fa2106b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Mon, 27 Jan 2020 17:50:36 +0100 Subject: [PATCH 2/2] Changelog --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 2f1e895c43..746dc595f5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -35,6 +35,7 @@ Changelog **Fixed** +- #1510 Error when viewing a Sample w/o Batch as client contact - #1505 Manage Analyses Form re-applies partitioned Analyses back to the Root - #1503 Avoid duplicate CSS IDs in multi-column Add form - #1501 Fix Attribute Error in Reference Sample Popup