diff --git a/InvenTree/company/templates/company/delete.html b/InvenTree/company/templates/company/delete.html index 1069d790e3..9a94404739 100644 --- a/InvenTree/company/templates/company/delete.html +++ b/InvenTree/company/templates/company/delete.html @@ -1,3 +1,7 @@ +{% extends "modal_delete_form.html" %} + +{% block pre_form_content %} + Are you sure you want to delete company '{{ company.name }}'?
@@ -11,3 +15,5 @@ If this supplier is deleted, these supplier part entries will also be deleted. {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index 0068d150ae..8e26d85a89 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -54,7 +54,7 @@ }); $('#delete-company').click(function() { - launchDeleteForm( + launchModalForm( "{% url 'company-delete' company.id %}", { redirect: "{% url 'company-index' %}" diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index f61da1fffa..0630556946 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -93,10 +93,12 @@ class CompanyCreate(AjaxCreateView): class CompanyDelete(AjaxDeleteView): """ View for deleting a Company object """ + model = Company success_url = '/company/' ajax_template_name = 'company/delete.html' ajax_form_title = 'Delete Company' + context_object_name = 'company' def get_data(self): return {