From dd56bc1fa531eca2a6e703443d9d3540e2eca4aa Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 18 May 2021 11:18:13 +0200 Subject: [PATCH] setup not realy needed --- InvenTree/order/views.py | 27 ++++++++++++-------------- InvenTree/part/views.py | 42 ++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 38 deletions(-) diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 9aa9b8d473..5d0acb9a7c 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -609,23 +609,20 @@ class PurchaseOrderUpload(FileManagementFormView): ) class MyFileManager(FileManager): - def setup(self): - self.REQUIRED_HEADERS = [ - 'Quantity', - ] + REQUIRED_HEADERS = [ + 'Quantity', + ] - self.ITEM_MATCH_HEADERS = [ - 'Manufacturer_MPN', - 'Supplier_SKU', - ] + ITEM_MATCH_HEADERS = [ + 'Manufacturer_MPN', + 'Supplier_SKU', + ] - self.OPTIONAL_HEADERS = [ - 'Purchase_Price', - 'Reference', - 'Notes', - ] - - return super().setup() + OPTIONAL_HEADERS = [ + 'Purchase_Price', + 'Reference', + 'Notes', + ] name = 'order' form_list_override = [ diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 65a5cc652d..1a792dd0ce 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -754,31 +754,27 @@ class PartImport(FileManagementFormView): 'default_supplier': 'default_supplier', } class MyManger(FileManager): - def setup(self): - self.REQUIRED_HEADERS = [ - 'Name', - 'Description', - ] + REQUIRED_HEADERS = [ + 'Name', + 'Description', + ] - self.OPTIONAL_MATCH_HEADERS = [ - 'Category', - 'default_location', - 'default_supplier', - ] - - self.OPTIONAL_HEADERS = [ - 'Keywords', - 'IPN', - 'Revision', - 'Link', - 'default_expiry', - 'minimum_stock', - 'Units', - 'Notes', - ] - - return super().setup() + OPTIONAL_MATCH_HEADERS = [ + 'Category', + 'default_location', + 'default_supplier', + ] + OPTIONAL_HEADERS = [ + 'Keywords', + 'IPN', + 'Revision', + 'Link', + 'default_expiry', + 'minimum_stock', + 'Units', + 'Notes', + ] file_manager_class = MyManger def get_field_selection(self):