diff --git a/InvenTree/InvenTree/static/script/inventree/modals.js b/InvenTree/InvenTree/static/script/inventree/modals.js index a1a6f3efdd..26eac5676b 100644 --- a/InvenTree/InvenTree/static/script/inventree/modals.js +++ b/InvenTree/InvenTree/static/script/inventree/modals.js @@ -493,6 +493,9 @@ function openModal(options) { var modal = options.modal || '#modal-form'; + // Ensure that the 'warning' div is hidden + $(modal).find('#form-validation-warning').css('display', 'none'); + $(modal).on('shown.bs.modal', function() { $(modal + ' .modal-form-content').scrollTop(0); if (options.focus) { diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index b8bab70fb8..d10b2a8b1b 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -245,7 +245,7 @@ def match_part_names(match, threshold=80, reverse=True, compare_length=False): if ratio >= threshold: matches.append({ 'part': part, - 'ratio': ratio + 'ratio': round(ratio, 1) }) matches = sorted(matches, key=lambda item: item['ratio'], reverse=reverse) diff --git a/InvenTree/part/templates/part/create_part.html b/InvenTree/part/templates/part/create_part.html index 4f1fcfb03a..d0e322d887 100644 --- a/InvenTree/part/templates/part/create_part.html +++ b/InvenTree/part/templates/part/create_part.html @@ -1,19 +1,23 @@ {% extends "modal_form.html" %} +{% load inventree_extras %} +{% load i18n %} {% block pre_form_content %} {{ block.super }} {% if matches %} -Possible Matching Parts -

The new part may be a duplicate of these existing parts:

-