Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to admin interface #9103

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/backend/InvenTree/build/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ class BuildAdmin(admin.ModelAdmin):

search_fields = ['reference', 'title', 'part__name', 'part__description']

autocomplete_fields = ['parent', 'part', 'sales_order', 'take_from', 'destination']
autocomplete_fields = [
'completed_by',
'destination',
'parent',
'part',
'project_code',
'responsible',
'sales_order',
'take_from',
]


@admin.register(BuildItem)
Expand All @@ -34,3 +43,5 @@ class BuildLineAdmin(admin.ModelAdmin):
list_display = ('build', 'bom_item', 'quantity')

search_fields = ['build__title', 'build__reference', 'bom_item__sub_part__name']

autocomplete_fields = ['bom_item', 'build']
25 changes: 22 additions & 3 deletions src/backend/InvenTree/order/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ class PurchaseOrderAdmin(admin.ModelAdmin):

inlines = [PurchaseOrderLineItemInlineAdmin]

autocomplete_fields = ['supplier', 'project_code', 'contact', 'address']
autocomplete_fields = [
'address',
'contact',
'created_by',
'destination',
'supplier',
'project_code',
'received_by',
'responsible',
]


@admin.register(models.SalesOrder)
Expand All @@ -55,7 +64,15 @@ class SalesOrderAdmin(admin.ModelAdmin):

search_fields = ['reference', 'customer__name', 'description']

autocomplete_fields = ['customer', 'project_code', 'contact', 'address']
autocomplete_fields = [
'address',
'contact',
'created_by',
'customer',
'project_code',
'responsible',
'shipped_by',
]


@admin.register(models.PurchaseOrderLineItem)
Expand Down Expand Up @@ -103,7 +120,7 @@ class SalesOrderShipmentAdmin(admin.ModelAdmin):

search_fields = ['reference', 'order__reference', 'order__customer__name']

autocomplete_fields = ('order',)
autocomplete_fields = ('order', 'checked_by')


@admin.register(models.SalesOrderAllocation)
Expand Down Expand Up @@ -134,6 +151,8 @@ class ReturnOrderLineItemAdmin(admin.ModelAdmin):

list_display = ['order', 'item', 'reference']

autocomplete_fields = ['item', 'order']


@admin.register(models.ReturnOrderExtraLine)
class ReturnOrdeerExtraLineAdmin(GeneralExtraLineAdmin, admin.ModelAdmin):
Expand Down
2 changes: 2 additions & 0 deletions src/backend/InvenTree/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ class InvenTreeUserAdmin(UserAdmin):
class OwnerAdmin(admin.ModelAdmin):
"""Custom admin interface for the Owner model."""

search_fields = ['name']


admin.site.unregister(Group)
admin.site.register(Group, RoleGroupAdmin)
Expand Down
Loading