setup not realy needed

This commit is contained in:
Matthias 2021-05-18 11:18:13 +02:00
parent 616dd76f8a
commit dd56bc1fa5
2 changed files with 31 additions and 38 deletions

View File

@ -609,23 +609,20 @@ class PurchaseOrderUpload(FileManagementFormView):
) )
class MyFileManager(FileManager): class MyFileManager(FileManager):
def setup(self): REQUIRED_HEADERS = [
self.REQUIRED_HEADERS = [ 'Quantity',
'Quantity', ]
]
self.ITEM_MATCH_HEADERS = [ ITEM_MATCH_HEADERS = [
'Manufacturer_MPN', 'Manufacturer_MPN',
'Supplier_SKU', 'Supplier_SKU',
] ]
self.OPTIONAL_HEADERS = [ OPTIONAL_HEADERS = [
'Purchase_Price', 'Purchase_Price',
'Reference', 'Reference',
'Notes', 'Notes',
] ]
return super().setup()
name = 'order' name = 'order'
form_list_override = [ form_list_override = [

View File

@ -754,31 +754,27 @@ class PartImport(FileManagementFormView):
'default_supplier': 'default_supplier', 'default_supplier': 'default_supplier',
} }
class MyManger(FileManager): class MyManger(FileManager):
def setup(self): REQUIRED_HEADERS = [
self.REQUIRED_HEADERS = [ 'Name',
'Name', 'Description',
'Description', ]
]
self.OPTIONAL_MATCH_HEADERS = [ OPTIONAL_MATCH_HEADERS = [
'Category', 'Category',
'default_location', 'default_location',
'default_supplier', 'default_supplier',
] ]
self.OPTIONAL_HEADERS = [
'Keywords',
'IPN',
'Revision',
'Link',
'default_expiry',
'minimum_stock',
'Units',
'Notes',
]
return super().setup()
OPTIONAL_HEADERS = [
'Keywords',
'IPN',
'Revision',
'Link',
'default_expiry',
'minimum_stock',
'Units',
'Notes',
]
file_manager_class = MyManger file_manager_class = MyManger
def get_field_selection(self): def get_field_selection(self):