Add some more search terms to the admin interface

This commit is contained in:
Oliver Walters 2020-09-29 23:41:50 +10:00
parent 1f6cbd7408
commit 0e5f10c020
4 changed files with 37 additions and 0 deletions

View File

@ -20,6 +20,12 @@ class BuildAdmin(ImportExportModelAdmin):
'notes',
)
search_fields = [
'title',
'part__name',
'part__description',
]
class BuildItemAdmin(admin.ModelAdmin):

View File

@ -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 """

View File

@ -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 """

View File

@ -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):