diff --git a/InvenTree/build/admin.py b/InvenTree/build/admin.py index 0ef5ccb75b..b47d38e36d 100644 --- a/InvenTree/build/admin.py +++ b/InvenTree/build/admin.py @@ -20,6 +20,12 @@ class BuildAdmin(ImportExportModelAdmin): 'notes', ) + search_fields = [ + 'title', + 'part__name', + 'part__description', + ] + class BuildItemAdmin(admin.ModelAdmin): diff --git a/InvenTree/company/admin.py b/InvenTree/company/admin.py index f69bfec54f..4a802c6a41 100644 --- a/InvenTree/company/admin.py +++ b/InvenTree/company/admin.py @@ -32,6 +32,11 @@ class CompanyAdmin(ImportExportModelAdmin): list_display = ('name', 'website', 'contact') + search_fields = [ + 'name', + 'description', + ] + class SupplierPartResource(ModelResource): """ Class for managing SupplierPart data import/export """ @@ -57,6 +62,13 @@ class SupplierPartAdmin(ImportExportModelAdmin): list_display = ('part', 'supplier', 'SKU') + search_fields = [ + 'company__name', + 'part__name', + 'MPN', + 'SKU', + ] + class SupplierPriceBreakResource(ModelResource): """ Class for managing SupplierPriceBreak data import/export """ diff --git a/InvenTree/order/admin.py b/InvenTree/order/admin.py index b7ac71976c..4519f8a2a9 100644 --- a/InvenTree/order/admin.py +++ b/InvenTree/order/admin.py @@ -23,6 +23,12 @@ class PurchaseOrderAdmin(ImportExportModelAdmin): 'creation_date' ) + search_fields = [ + 'reference', + 'supplier__name', + 'description', + ] + class SalesOrderAdmin(ImportExportModelAdmin): @@ -34,6 +40,12 @@ class SalesOrderAdmin(ImportExportModelAdmin): 'creation_date', ) + search_fields = [ + 'reference', + 'customer__name', + 'description', + ] + class POLineItemResource(ModelResource): """ Class for managing import / export of POLineItem data """ diff --git a/InvenTree/stock/admin.py b/InvenTree/stock/admin.py index d3f0c31f8b..924a8de4c7 100644 --- a/InvenTree/stock/admin.py +++ b/InvenTree/stock/admin.py @@ -117,6 +117,13 @@ class StockItemAdmin(ImportExportModelAdmin): list_display = ('part', 'quantity', 'location', 'status', 'updated') + # A list of search fields which can be used for lookup on matching 'autocomplete' fields + search_fields = [ + 'part__name', + 'part__description', + 'serial', + 'batch', + ] class StockAttachmentAdmin(admin.ModelAdmin):