diff --git a/InvenTree/part/admin.py b/InvenTree/part/admin.py index 637dbbf2cf..2e434d928d 100644 --- a/InvenTree/part/admin.py +++ b/InvenTree/part/admin.py @@ -111,6 +111,13 @@ class PartCategoryResource(ModelResource): PartCategory.objects.rebuild() +class PartCategoryInline(admin.TabularInline): + """ + Inline for PartCategory model + """ + model = PartCategory + + class PartCategoryAdmin(ImportExportModelAdmin): resource_class = PartCategoryResource @@ -119,6 +126,10 @@ class PartCategoryAdmin(ImportExportModelAdmin): search_fields = ('name', 'description') + inlines = [ + PartCategoryInline, + ] + class PartRelatedAdmin(admin.ModelAdmin): ''' Class to manage PartRelated objects ''' diff --git a/InvenTree/stock/admin.py b/InvenTree/stock/admin.py index f32fa008a0..5f1b134966 100644 --- a/InvenTree/stock/admin.py +++ b/InvenTree/stock/admin.py @@ -44,6 +44,13 @@ class LocationResource(ModelResource): StockLocation.objects.rebuild() +class LocationInline(admin.TabularInline): + """ + Inline for sub-locations + """ + model = StockLocation + + class LocationAdmin(ImportExportModelAdmin): resource_class = LocationResource @@ -52,6 +59,10 @@ class LocationAdmin(ImportExportModelAdmin): search_fields = ('name', 'description') + inlines = [ + LocationInline, + ] + class StockItemResource(ModelResource): """ Class for managing StockItem data import/export """