diff --git a/InvenTree/common/files.py b/InvenTree/common/files.py index 377120f44d..759ff04ee7 100644 --- a/InvenTree/common/files.py +++ b/InvenTree/common/files.py @@ -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 diff --git a/InvenTree/part/templates/part/import_wizard/match_fields.html b/InvenTree/part/templates/part/import_wizard/match_fields.html new file mode 100644 index 0000000000..54008d6bae --- /dev/null +++ b/InvenTree/part/templates/part/import_wizard/match_fields.html @@ -0,0 +1,99 @@ +{% extends "part/import_wizard/part_upload.html" %} +{% load inventree_extras %} +{% load i18n %} +{% load static %} + +{% block form_alert %} +{% if missing_columns and missing_columns|length > 0 %} +
{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %} + {% if description %}- {{ description }}{% endif %}
+ + {% block form_alert %} + {% endblock form_alert %} + + + {% endblock form_buttons_bottom %} + + {% else %} +