diff --git a/InvenTree/company/templates/company/partdelete.html b/InvenTree/company/templates/company/partdelete.html
index 53d8edac13..13ba71e2ca 100644
--- a/InvenTree/company/templates/company/partdelete.html
+++ b/InvenTree/company/templates/company/partdelete.html
@@ -1,5 +1 @@
-{% extends 'delete_obj.html' %}
-
-{% block del_title %}
-Are you sure you want to delete this supplier part?
-{% endblock %}
\ No newline at end of file
+Are you sure you want to delete this supplier part?
\ No newline at end of file
diff --git a/InvenTree/company/templates/company/partdetail.html b/InvenTree/company/templates/company/partdetail.html
index 41a2a8652a..82fb30bdef 100644
--- a/InvenTree/company/templates/company/partdetail.html
+++ b/InvenTree/company/templates/company/partdetail.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-
+{% load static %}
{% block content %}
Supplier part information
@@ -30,13 +30,40 @@
+{% include 'modal.html' %}
+{% include 'modal_delete.html' %}
+
+{% endblock %}
+
+{% block javascript %}
+
+
+
+
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py
index 1d6a46f4b3..d1986baf11 100644
--- a/InvenTree/part/forms.py
+++ b/InvenTree/part/forms.py
@@ -80,11 +80,7 @@ class EditSupplierPartForm(forms.ModelForm):
super(EditSupplierPartForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
- self.helper.form_id = 'id-edit-part-form'
- self.helper.form_class = 'blueForms'
- self.helper.form_method = 'post'
-
- self.helper.add_input(Submit('submit', 'Submit'))
+ self.helper.form_tag = False
class Meta:
model = SupplierPart
diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html
index bb1b5c7eed..957813a27a 100644
--- a/InvenTree/part/templates/part/bom.html
+++ b/InvenTree/part/templates/part/bom.html
@@ -74,7 +74,8 @@ $(document).ready(function(){
$("#new-bom-item").click(function () {
launchModalForm("#modal-form",
- "{% url 'bom-item-create' %}/?parent={{ part.id }}");
+ "{% url 'bom-item-create' %}",
+ {data: {parent: {{ part.id }} }});
});
});
diff --git a/InvenTree/part/templates/part/supplier.html b/InvenTree/part/templates/part/supplier.html
index 27483a4f55..bef5ca496c 100644
--- a/InvenTree/part/templates/part/supplier.html
+++ b/InvenTree/part/templates/part/supplier.html
@@ -1,18 +1,21 @@
{% extends "part/part_base.html" %}
-
+{% load static %}
{% block details %}
{% include 'part/tabs.html' with tab='suppliers' %}
Part Suppliers
-
+
+
| SKU |
Supplier |
MPN |
URL |
+
+
{% for spart in part.supplier_parts.all %}
| {{ spart.SKU }} |
@@ -25,12 +28,38 @@
{% endfor %}
+
+{% include 'modal.html' %}
+
+{% endblock %}
+
+{% block javascript %}
+
+``
+
+
+
+
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py
index 97ad44a91e..1b3ec0708b 100644
--- a/InvenTree/part/views.py
+++ b/InvenTree/part/views.py
@@ -224,17 +224,21 @@ class SupplierPartDetail(DetailView):
queryset = SupplierPart.objects.all()
-class SupplierPartEdit(UpdateView):
+class SupplierPartEdit(AjaxUpdateView):
model = SupplierPart
template_name = 'company/partedit.html'
context_object_name = 'part'
form_class = EditSupplierPartForm
+ ajax_template_name = 'modal_form.html'
+ ajax_form_title = 'Edit Supplier Part'
-class SupplierPartCreate(CreateView):
+class SupplierPartCreate(AjaxCreateView):
model = SupplierPart
form_class = EditSupplierPartForm
- template_name = 'company/partcreate.html'
+ ajax_template_name = 'modal_form.html'
+ ajax_form_title = 'Create new Supplier Part'
+ #template_name = 'company/partcreate.html'
context_object_name = 'part'
def get_initial(self):
@@ -255,13 +259,7 @@ class SupplierPartCreate(CreateView):
return initials
-class SupplierPartDelete(DeleteView):
+class SupplierPartDelete(AjaxDeleteView):
model = SupplierPart
success_url = '/supplier/'
template_name = 'company/partdelete.html'
-
- def post(self, request, *args, **kwargs):
- if 'confirm' in request.POST:
- return super(SupplierPartDelete, self).post(request, *args, **kwargs)
- else:
- return HttpResponseRedirect(self.get_object().get_absolute_url())