2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

templates and FileManagement config

This commit is contained in:
2021-05-15 00:57:18 +02:00
parent 307a097ab4
commit 8effdffe6f
5 changed files with 296 additions and 0 deletions

View File

@ -109,6 +109,27 @@ class FileManager:
# Update headers
self.update_headers()
if self.name == 'part':
self.REQUIRED_HEADERS = [
'Name',
'Description',
]
self.OPTIONAL_HEADERS = [
'Keywords',
'IPN',
'Revision',
'Link',
'default_expiry',
'minimum_stock',
'Units',
'Notes',
]
# Update headers
self.update_headers()
def guess_header(self, header, threshold=80):
""" Try to match a header (from the file) to a list of known headers