diff --git a/CHANGES.rst b/CHANGES.rst index 7f0c4049a7..403e2a9d23 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -41,6 +41,7 @@ Changelog **Removed** +- #1535 Remove `zcatalog` monkey (and `getRequestUID` index) - #1518 Removed stale indexes from `analysis_catalog` - #1516 Removed getResultsRange metadata from analysis_catalog - #1487 Dexterity Compatible Catalog Base Class diff --git a/bika/lims/browser/analysisrequest/tables.py b/bika/lims/browser/analysisrequest/tables.py index 54b42e681d..72f7daae75 100644 --- a/bika/lims/browser/analysisrequest/tables.py +++ b/bika/lims/browser/analysisrequest/tables.py @@ -33,7 +33,7 @@ def __init__(self, context, request): self.contentFilter.update({ "getPointOfCapture": "lab", - "getRequestUID": api.get_uid(context) + "getAncestorsUIDs": [api.get_uid(context)] }) self.form_id = "lab_analyses" @@ -52,7 +52,7 @@ def __init__(self, context, request): self.contentFilter.update({ "getPointOfCapture": "field", - "getRequestUID": api.get_uid(context) + "getAncestorsUIDs": [api.get_uid(context)] }) self.form_id = "field_analyses" diff --git a/bika/lims/catalog/analysis_catalog.py b/bika/lims/catalog/analysis_catalog.py index 4e85931638..ea511dc8b6 100644 --- a/bika/lims/catalog/analysis_catalog.py +++ b/bika/lims/catalog/analysis_catalog.py @@ -37,7 +37,6 @@ _indexes_dict = { "sortable_title": "FieldIndex", "getParentUID": "FieldIndex", - "getRequestUID": "FieldIndex", "getDueDate": "DateIndex", "getDateReceived": "DateIndex", "getResultCaptureDate": "DateIndex", diff --git a/bika/lims/monkey/configure.zcml b/bika/lims/monkey/configure.zcml index 9bc64bdfba..cc2a1cb013 100644 --- a/bika/lims/monkey/configure.zcml +++ b/bika/lims/monkey/configure.zcml @@ -58,12 +58,4 @@ replacement=".Widget.isVisible" /> - - - diff --git a/bika/lims/monkey/zcatalog.py b/bika/lims/monkey/zcatalog.py deleted file mode 100644 index a93b5895d6..0000000000 --- a/bika/lims/monkey/zcatalog.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of SENAITE.CORE. -# -# SENAITE.CORE is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright 2018-2020 by it's authors. -# Some rights reserved, see README and LICENSE. - -from bika.lims.catalog.analysis_catalog import CATALOG_ANALYSIS_LISTING - - -def searchResults(self, REQUEST=None, used=None, **kw): - """Search the catalog - - Search terms can be passed in the REQUEST or as keyword - arguments. - - The used argument is now deprecated and ignored - """ - if REQUEST and REQUEST.get('getRequestUID') \ - and self.id == CATALOG_ANALYSIS_LISTING: - - # Fetch all analyses that have the request UID passed in as an ancestor, - # cause we want for Samples to always return the contained analyses plus - # those contained in partitions - request = REQUEST.copy() - orig_uid = request.get('getRequestUID') - - # Get all analyses, those from descendant ARs included - del request['getRequestUID'] - request['getAncestorsUIDs'] = orig_uid - return self.searchResults(REQUEST=request, used=used, **kw) - - # Normal search - return self._catalog.searchResults(REQUEST, used, **kw) diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index 815002103e..a04069f3d3 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -216,6 +216,7 @@ # Only used in Add analyses (as sortable column) (CATALOG_ANALYSIS_LISTING, "getClientOrderNumber"), (CATALOG_ANALYSIS_LISTING, "getDateSampled"), + (CATALOG_ANALYSIS_LISTING, "getRequestUID"), ]