Filtering for report snippets (#12487)

* Filtering for report snippets

* Bump API version
This commit is contained in:
Oliver
2026-07-28 22:52:54 +10:00
committed by GitHub
parent 1cee1bdefb
commit e6d1ceb20b
3 changed files with 6 additions and 3 deletions
@@ -1,11 +1,14 @@
"""InvenTree API version information.""" """InvenTree API version information."""
# InvenTree API version # 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.""" """Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
INVENTREE_API_TEXT = """ 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 v529 -> 2026-07-26 : https://github.com/inventree/InvenTree/pull/12471
- Adds "on_order" filter to the Part API - Adds "on_order" filter to the Part API
- Enable sorting by "ordering" quantity on the Part API endpoint - Enable sorting by "ordering" quantity on the Part API endpoint
+2
View File
@@ -356,6 +356,8 @@ class ReportSnippetList(TemplatePermissionMixin, ListCreateAPI):
queryset = report.models.ReportSnippet.objects.all() queryset = report.models.ReportSnippet.objects.all()
serializer_class = report.serializers.ReportSnippetSerializer serializer_class = report.serializers.ReportSnippetSerializer
filter_backends = SEARCH_ORDER_FILTER
search_fields = ['snippet', 'description']
class ReportSnippetDetail(TemplatePermissionMixin, RetrieveUpdateDestroyAPI): class ReportSnippetDetail(TemplatePermissionMixin, RetrieveUpdateDestroyAPI):
@@ -231,8 +231,6 @@ export default function SnippetTable() {
props={{ props={{
rowActions: rowActions, rowActions: rowActions,
tableActions: tableActions, tableActions: tableActions,
enableSearch: false,
enableFilters: false,
onRowClick: (record) => openDetailDrawer(record.pk) onRowClick: (record) => openDetailDrawer(record.pk)
}} }}
/> />