From 35451248c2bdd4d76c256e8ca0221f4478399d13 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 6 Jun 2021 15:25:56 +0200 Subject: [PATCH] reseting modal on open --- InvenTree/common/views.py | 4 ++++ InvenTree/templates/InvenTree/settings/part.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/views.py b/InvenTree/common/views.py index 92268d0023..d486b2b32e 100644 --- a/InvenTree/common/views.py +++ b/InvenTree/common/views.py @@ -584,6 +584,10 @@ class FileManagementAjaxView(AjaxView): return self.renderJsonResponse(request, data={'form_valid': None}) def get(self, request): + if 'reset' in request.GET: + # reset form + self.storage.reset() + self.storage.current_step = self.steps.first self.setTemplate() return self.renderJsonResponse(request) diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html index 7c7245f96e..6502d920e3 100644 --- a/InvenTree/templates/InvenTree/settings/part.html +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -138,7 +138,7 @@ }); $("#import-part").click(function() { - launchModalForm("{% url 'api-part-import' %}", {}); + launchModalForm("{% url 'api-part-import' %}?reset", {}); }); {% endblock %} \ No newline at end of file