mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Adds autocomplete fields to admin pages for "company" app
This commit is contained in:
		| @@ -71,6 +71,8 @@ class SupplierPartAdmin(ImportExportModelAdmin): | ||||
|         'SKU', | ||||
|     ] | ||||
|  | ||||
|     autocomplete_fields = ('part', 'supplier', 'manufacturer_part',) | ||||
|  | ||||
|  | ||||
| class ManufacturerPartResource(ModelResource): | ||||
|     """ | ||||
| @@ -92,23 +94,6 @@ class ManufacturerPartResource(ModelResource): | ||||
|         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): | ||||
|     """ | ||||
|     Admin class for ManufacturerPart model | ||||
| @@ -124,10 +109,7 @@ class ManufacturerPartAdmin(ImportExportModelAdmin): | ||||
|         'MPN', | ||||
|     ] | ||||
|  | ||||
|     inlines = [ | ||||
|         SupplierPartInline, | ||||
|         ManufacturerPartParameterInline, | ||||
|     ] | ||||
|     autocomplete_fields = ('part', 'manufacturer',) | ||||
|  | ||||
|  | ||||
| class ManufacturerPartParameterResource(ModelResource): | ||||
| @@ -157,6 +139,8 @@ class ManufacturerPartParameterAdmin(ImportExportModelAdmin): | ||||
|         'value' | ||||
|     ] | ||||
|  | ||||
|     autocomplete_fields = ('manufacturer_part',) | ||||
|  | ||||
|  | ||||
| class SupplierPriceBreakResource(ModelResource): | ||||
|     """ Class for managing SupplierPriceBreak data import/export """ | ||||
| @@ -186,6 +170,8 @@ class SupplierPriceBreakAdmin(ImportExportModelAdmin): | ||||
|  | ||||
|     list_display = ('part', 'quantity', 'price') | ||||
|  | ||||
|     autocomplete_fields = ('part',) | ||||
|  | ||||
|  | ||||
| admin.site.register(Company, CompanyAdmin) | ||||
| admin.site.register(SupplierPart, SupplierPartAdmin) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user