mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
Make Tree Path searchable (#7786)
* make tree searchable by pathstring * fix related model field colors in dark mode * remove unused import --------- Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
@ -43,7 +43,6 @@ from InvenTree.mixins import (
|
||||
from InvenTree.permissions import RolePermission
|
||||
from InvenTree.serializers import EmptySerializer
|
||||
from order.status_codes import PurchaseOrderStatusGroups, SalesOrderStatusGroups
|
||||
from part.admin import PartCategoryResource, PartResource
|
||||
from stock.models import StockLocation
|
||||
|
||||
from . import serializers as part_serializers
|
||||
@ -245,7 +244,7 @@ class CategoryList(CategoryMixin, DataExportViewMixin, ListCreateAPI):
|
||||
# Use hierarchical ordering by default
|
||||
ordering = ['tree_id', 'lft', 'name']
|
||||
|
||||
search_fields = ['name', 'description']
|
||||
search_fields = ['name', 'description', 'pathstring']
|
||||
|
||||
|
||||
class CategoryDetail(CategoryMixin, CustomRetrieveUpdateDestroyAPI):
|
||||
|
@ -418,7 +418,7 @@ class StockLocationList(DataExportViewMixin, ListCreateAPI):
|
||||
|
||||
filter_backends = SEARCH_ORDER_FILTER
|
||||
|
||||
search_fields = ['name', 'description', 'tags__name', 'tags__slug']
|
||||
search_fields = ['name', 'description', 'pathstring', 'tags__name', 'tags__slug']
|
||||
|
||||
ordering_fields = ['name', 'pathstring', 'items', 'level', 'tree_id', 'lft']
|
||||
|
||||
|
Reference in New Issue
Block a user