mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
Adds autocomplete fields to admin pages for "company" app
This commit is contained in:
parent
1667af4c07
commit
71aa6a910d
@ -71,6 +71,8 @@ class SupplierPartAdmin(ImportExportModelAdmin):
|
|||||||
'SKU',
|
'SKU',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
autocomplete_fields = ('part', 'supplier', 'manufacturer_part',)
|
||||||
|
|
||||||
|
|
||||||
class ManufacturerPartResource(ModelResource):
|
class ManufacturerPartResource(ModelResource):
|
||||||
"""
|
"""
|
||||||
@ -92,23 +94,6 @@ class ManufacturerPartResource(ModelResource):
|
|||||||
clean_model_instances = True
|
clean_model_instances = True
|
||||||
|
|
||||||
|
|
||||||
class ManufacturerPartParameterInline(admin.TabularInline):
|
|
||||||
"""
|
|
||||||
Inline for editing ManufacturerPartParameter objects,
|
|
||||||
directly from the ManufacturerPart admin view.
|
|
||||||
"""
|
|
||||||
|
|
||||||
model = ManufacturerPartParameter
|
|
||||||
|
|
||||||
|
|
||||||
class SupplierPartInline(admin.TabularInline):
|
|
||||||
"""
|
|
||||||
Inline for the SupplierPart model
|
|
||||||
"""
|
|
||||||
|
|
||||||
model = SupplierPart
|
|
||||||
|
|
||||||
|
|
||||||
class ManufacturerPartAdmin(ImportExportModelAdmin):
|
class ManufacturerPartAdmin(ImportExportModelAdmin):
|
||||||
"""
|
"""
|
||||||
Admin class for ManufacturerPart model
|
Admin class for ManufacturerPart model
|
||||||
@ -124,10 +109,7 @@ class ManufacturerPartAdmin(ImportExportModelAdmin):
|
|||||||
'MPN',
|
'MPN',
|
||||||
]
|
]
|
||||||
|
|
||||||
inlines = [
|
autocomplete_fields = ('part', 'manufacturer',)
|
||||||
SupplierPartInline,
|
|
||||||
ManufacturerPartParameterInline,
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class ManufacturerPartParameterResource(ModelResource):
|
class ManufacturerPartParameterResource(ModelResource):
|
||||||
@ -157,6 +139,8 @@ class ManufacturerPartParameterAdmin(ImportExportModelAdmin):
|
|||||||
'value'
|
'value'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
autocomplete_fields = ('manufacturer_part',)
|
||||||
|
|
||||||
|
|
||||||
class SupplierPriceBreakResource(ModelResource):
|
class SupplierPriceBreakResource(ModelResource):
|
||||||
""" Class for managing SupplierPriceBreak data import/export """
|
""" Class for managing SupplierPriceBreak data import/export """
|
||||||
@ -186,6 +170,8 @@ class SupplierPriceBreakAdmin(ImportExportModelAdmin):
|
|||||||
|
|
||||||
list_display = ('part', 'quantity', 'price')
|
list_display = ('part', 'quantity', 'price')
|
||||||
|
|
||||||
|
autocomplete_fields = ('part',)
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Company, CompanyAdmin)
|
admin.site.register(Company, CompanyAdmin)
|
||||||
admin.site.register(SupplierPart, SupplierPartAdmin)
|
admin.site.register(SupplierPart, SupplierPartAdmin)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user