From 9a42421852b0fe69264b25cac4a2a598283ceaa4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 18 May 2021 11:20:25 +0200 Subject: [PATCH] restructure overrides --- InvenTree/part/views.py | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 1a792dd0ce..b9c4d2ec03 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -726,6 +726,29 @@ class PartCreate(AjaxCreateView): class PartImport(FileManagementFormView): ''' Part: Upload file, match to fields and import parts(using multi-Step form) ''' + class MyFileManager(FileManager): + REQUIRED_HEADERS = [ + 'Name', + 'Description', + ] + + OPTIONAL_MATCH_HEADERS = [ + 'Category', + 'default_location', + 'default_supplier', + ] + + OPTIONAL_HEADERS = [ + 'Keywords', + 'IPN', + 'Revision', + 'Link', + 'default_expiry', + 'minimum_stock', + 'Units', + 'Notes', + ] + name = 'part' form_steps_template = [ 'part/import_wizard/part_upload.html', @@ -753,29 +776,7 @@ class PartImport(FileManagementFormView): 'default_location': 'default_location', 'default_supplier': 'default_supplier', } - class MyManger(FileManager): - REQUIRED_HEADERS = [ - 'Name', - 'Description', - ] - - OPTIONAL_MATCH_HEADERS = [ - 'Category', - 'default_location', - 'default_supplier', - ] - - OPTIONAL_HEADERS = [ - 'Keywords', - 'IPN', - 'Revision', - 'Link', - 'default_expiry', - 'minimum_stock', - 'Units', - 'Notes', - ] - file_manager_class = MyManger + file_manager_class = MyFileManager def get_field_selection(self): """ Fill the form fields for step 3 """