Add autocomplete fields to admin views for "build" app

This commit is contained in:
Oliver 2021-12-04 20:16:53 +11:00
parent 71aa6a910d
commit cdf63c43aa
2 changed files with 17 additions and 2 deletions

View File

@ -29,6 +29,14 @@ class BuildAdmin(ImportExportModelAdmin):
'part__description', 'part__description',
] ]
autocomplete_fields = [
'parent',
'part',
'sales_order',
'take_from',
'destination',
]
class BuildItemAdmin(admin.ModelAdmin): class BuildItemAdmin(admin.ModelAdmin):
@ -38,6 +46,13 @@ class BuildItemAdmin(admin.ModelAdmin):
'quantity' 'quantity'
) )
autocomplete_fields = [
'build',
'bom_item',
'stock_item',
'install_into',
]
admin.site.register(Build, BuildAdmin) admin.site.register(Build, BuildAdmin)
admin.site.register(BuildItem, BuildItemAdmin) admin.site.register(BuildItem, BuildItemAdmin)

View File

@ -126,7 +126,7 @@ class PartRelatedAdmin(admin.ModelAdmin):
""" """
Class to manage PartRelated objects Class to manage PartRelated objects
""" """
autocomplete_fields = ('part_1', 'part_2') autocomplete_fields = ('part_1', 'part_2')
@ -147,7 +147,7 @@ class PartStarAdmin(admin.ModelAdmin):
class PartCategoryStarAdmin(admin.ModelAdmin): class PartCategoryStarAdmin(admin.ModelAdmin):
list_display = ('category', 'user') list_display = ('category', 'user')
autocomplete_fields = ('category',) autocomplete_fields = ('category',)