From e6d1ceb20b3e052382b1d5160ea100287c5a4617 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 28 Jul 2026 22:52:54 +1000 Subject: [PATCH] Filtering for report snippets (#12487) * Filtering for report snippets * Bump API version --- src/backend/InvenTree/InvenTree/api_version.py | 5 ++++- src/backend/InvenTree/report/api.py | 2 ++ src/frontend/src/tables/settings/SnippetTable.tsx | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index d1759eb85b..e4602695e0 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,14 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 529 +INVENTREE_API_VERSION = 530 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v530 -> 2026-07-28 : https://github.com/inventree/InvenTree/pull/12487 + - Adds searching against ReportSnippet API endpoint + v529 -> 2026-07-26 : https://github.com/inventree/InvenTree/pull/12471 - Adds "on_order" filter to the Part API - Enable sorting by "ordering" quantity on the Part API endpoint diff --git a/src/backend/InvenTree/report/api.py b/src/backend/InvenTree/report/api.py index f478a1b1b0..a62d2b7a98 100644 --- a/src/backend/InvenTree/report/api.py +++ b/src/backend/InvenTree/report/api.py @@ -356,6 +356,8 @@ class ReportSnippetList(TemplatePermissionMixin, ListCreateAPI): queryset = report.models.ReportSnippet.objects.all() serializer_class = report.serializers.ReportSnippetSerializer + filter_backends = SEARCH_ORDER_FILTER + search_fields = ['snippet', 'description'] class ReportSnippetDetail(TemplatePermissionMixin, RetrieveUpdateDestroyAPI): diff --git a/src/frontend/src/tables/settings/SnippetTable.tsx b/src/frontend/src/tables/settings/SnippetTable.tsx index 68bde47739..b89e8de010 100644 --- a/src/frontend/src/tables/settings/SnippetTable.tsx +++ b/src/frontend/src/tables/settings/SnippetTable.tsx @@ -231,8 +231,6 @@ export default function SnippetTable() { props={{ rowActions: rowActions, tableActions: tableActions, - enableSearch: false, - enableFilters: false, onRowClick: (record) => openDetailDrawer(record.pk) }} />