diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index 3daeedcebb..8f1241de01 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -102,26 +102,23 @@ class BomUploadManager: # Fields which are absolutely necessary for valid upload REQUIRED_HEADERS = [ - 'Part', + 'Part_Name', 'Quantity' ] # Fields which would be helpful but are not required OPTIONAL_HEADERS = [ + 'Part_IPN', + 'Part_ID', 'Reference', - 'Notes', + 'Note', 'Overage', - 'Description', - 'Category', - 'Supplier', - 'Manufacturer', - 'MPN', - 'IPN', ] EDITABLE_HEADERS = [ 'Reference', - 'Notes' + 'Note', + 'Overage' ] HEADERS = REQUIRED_HEADERS + OPTIONAL_HEADERS @@ -171,6 +168,11 @@ class BomUploadManager: if h.lower() == header.lower(): return h + # Try for a case-insensitive match with space replacement + for h in self.HEADERS: + if h.lower() == header.lower().replace(' ', '_'): + return h + # Finally, look for a close match using fuzzy matching matches = [] diff --git a/InvenTree/part/templates/part/bom_upload/select_fields.html b/InvenTree/part/templates/part/bom_upload/select_fields.html index d49b1c12ce..bd0c222881 100644 --- a/InvenTree/part/templates/part/bom_upload/select_fields.html +++ b/InvenTree/part/templates/part/bom_upload/select_fields.html @@ -1,17 +1,18 @@ {% extends "part/part_base.html" %} {% load static %} +{% load i18n %} {% load inventree_extras %} {% block details %} {% include "part/tabs.html" with tab='bom' %} -
Step 2 - Select Fields
+{% trans "Step 2 - Select Fields" %}