2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

inherited setup method

This commit is contained in:
2021-05-18 01:55:47 +02:00
parent eafaf92ae2
commit 92f8bd36f1
4 changed files with 65 additions and 47 deletions

View File

@ -31,6 +31,7 @@ from part.models import Part
from common.models import InvenTreeSetting
from common.views import FileManagementFormView
from common.files import FileManager
from . import forms as order_forms
from part.views import PartPricing
@ -591,6 +592,26 @@ class PurchaseOrderUpload(FileManagementFormView):
'reference': 'reference',
'notes': 'notes',
}
class MyManger(FileManager):
def setup(self):
self.REQUIRED_HEADERS = [
'Quantity',
]
self.ITEM_MATCH_HEADERS = [
'Manufacturer_MPN',
'Supplier_SKU',
]
self.OPTIONAL_HEADERS = [
'Purchase_Price',
'Reference',
'Notes',
]
return super().setup()
file_manager_class = MyManger
def get_order(self):
""" Get order or return 404 """