From fbd5a2a2708d9586c7969e31443cefcf0c87b169 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 30 Apr 2019 16:35:40 +1000 Subject: [PATCH] Register BuildItem in admin interface --- InvenTree/build/admin.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/InvenTree/build/admin.py b/InvenTree/build/admin.py index 9662f6bf79..0ef5ccb75b 100644 --- a/InvenTree/build/admin.py +++ b/InvenTree/build/admin.py @@ -2,21 +2,33 @@ from __future__ import unicode_literals from django.contrib import admin +from import_export.admin import ImportExportModelAdmin -from .models import Build +from .models import Build, BuildItem -class BuildAdmin(admin.ModelAdmin): +class BuildAdmin(ImportExportModelAdmin): - list_display = ('part', - 'status', - 'batch', - 'quantity', - 'creation_date', - 'completion_date', - 'title', - 'notes', - ) + list_display = ( + 'part', + 'status', + 'batch', + 'quantity', + 'creation_date', + 'completion_date', + 'title', + 'notes', + ) + + +class BuildItemAdmin(admin.ModelAdmin): + + list_display = ( + 'build', + 'stock_item', + 'quantity' + ) admin.site.register(Build, BuildAdmin) +admin.site.register(BuildItem, BuildItemAdmin)