Конкретно пересмотрел логику работы. Легаси вынесена в архив
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
All checks were successful
Deploy MES Core / deploy (push) Successful in 13s
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import BOM, ProductEntity, RouteStub
|
||||
from .models import BOM, EntityOperation, Operation, ProductEntity
|
||||
|
||||
|
||||
@admin.register(RouteStub)
|
||||
class RouteStubAdmin(admin.ModelAdmin):
|
||||
list_display = ('name',)
|
||||
search_fields = ('name',)
|
||||
@admin.register(Operation)
|
||||
class OperationAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'code', 'workshop')
|
||||
search_fields = ('name', 'code')
|
||||
list_filter = ('workshop',)
|
||||
autocomplete_fields = ('workshop',)
|
||||
|
||||
|
||||
class EntityOperationInline(admin.TabularInline):
|
||||
model = EntityOperation
|
||||
fields = ('seq', 'operation')
|
||||
autocomplete_fields = ('operation',)
|
||||
extra = 5
|
||||
|
||||
|
||||
class BOMChildInline(admin.TabularInline):
|
||||
@@ -31,8 +40,8 @@ class ProductEntityAdmin(admin.ModelAdmin):
|
||||
)
|
||||
list_filter = ('entity_type', 'planned_material__category')
|
||||
search_fields = ('drawing_number', 'name', 'planned_material__name', 'planned_material__full_name')
|
||||
autocomplete_fields = ('planned_material', 'route')
|
||||
inlines = (BOMChildInline,)
|
||||
autocomplete_fields = ('planned_material',)
|
||||
inlines = (EntityOperationInline, BOMChildInline,)
|
||||
|
||||
|
||||
@admin.register(BOM)
|
||||
|
||||
Reference in New Issue
Block a user