diff --git a/InvenTree/order/templates/order/sales_order_notes.html b/InvenTree/order/templates/order/sales_order_notes.html deleted file mode 100644 index 0a2e105b2e..0000000000 --- a/InvenTree/order/templates/order/sales_order_notes.html +++ /dev/null @@ -1,56 +0,0 @@ -{% extends "order/sales_order_base.html" %} - -{% load inventree_extras %} -{% load i18n %} -{% load static %} -{% load markdownify %} -{% load status_codes %} - -{% block menubar %} -{% include 'order/so_navbar.html' with tab='notes' %} -{% endblock %} - -{% block heading %} -{% trans "Sales Order Notes" %} -{% if roles.sales_order.change and not editing %} - -{% endif %} -{% endblock %} - -{% block details %} - -{% if editing %} - -
- {% csrf_token %} - - {{ form }} -
- -
- -{{ form.media }} - -{% else %} -
-
- {{ order.notes | markdownify }} -
-
- -{% endif %} - -{% endblock %} - -{% block js_ready %} - -{{ block.super }} - -{% if editing %} -{% else %} -$("#edit-notes").click(function() { - location.href = "{% url 'so-notes' order.id %}?edit=1"; -}); -{% endif %} - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_attachments.html b/InvenTree/order/templates/order/so_attachments.html deleted file mode 100644 index 9c29fe5abe..0000000000 --- a/InvenTree/order/templates/order/so_attachments.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "order/sales_order_base.html" %} - -{% load inventree_extras %} -{% load i18n %} -{% load static %} - -{% block menubar %} -{% include 'order/so_navbar.html' with tab='attachments' %} -{% endblock %} - -{% block heading %} -{% trans "Sales Order Attachments" %} -{% endblock %} - -{% block details %} - -{% include "attachment_table.html" with attachments=order.attachments.all %} - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - -enableDragAndDrop( - '#attachment-dropzone', - '{% url "api-so-attachment-list" %}', - { - data: { - order: {{ order.id }}, - }, - label: 'attachment', - success: function(data, status, xhr) { - location.reload(); - } - } -); - -loadAttachmentTable( - '{% url "api-so-attachment-list" %}', - { - filters: { - order: {{ order.pk }}, - }, - onEdit: function(pk) { - var url = `/api/order/so/attachment/${pk}/`; - - constructForm(url, { - fields: { - comment: {}, - }, - onSuccess: reloadAttachmentTable, - title: '{% trans "Edit Attachment" %}', - }); - }, - onDelete: function(pk) { - constructForm(`/api/order/so/attachment/${pk}/`, { - method: 'DELETE', - confirmMessage: '{% trans "Confirm Delete Operation" %}', - title: '{% trans "Delete Attachment" %}', - onSuccess: reloadAttachmentTable, - }); - } - } -); - -$("#new-attachment").click(function() { - - constructForm('{% url "api-so-attachment-list" %}', { - method: 'POST', - fields: { - attachment: {}, - comment: {}, - order: { - value: {{ order.pk }}, - hidden: true - } - }, - onSuccess: reloadAttachmentTable, - title: '{% trans "Add Attachment" %}' - }); -}); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_builds.html b/InvenTree/order/templates/order/so_builds.html deleted file mode 100644 index e29a76b64d..0000000000 --- a/InvenTree/order/templates/order/so_builds.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "order/sales_order_base.html" %} - -{% load inventree_extras %} -{% load i18n %} -{% load static %} - -{% block menubar %} -{% include 'order/so_navbar.html' with tab='builds' %} -{% endblock %} - -{% block heading %} -{% trans "Build Orders" %} -{% endblock %} - -{% block details %} - - -
- -{% endblock %} - -{% block js_ready %} - -{{ block.super }} - -loadBuildTable($("#builds-table"), { - url: "{% url 'api-build-list' %}", - params: { - sales_order: {{ order.id }}, - }, -}); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/urls.py b/InvenTree/order/urls.py index 16be6e77ce..768607a93b 100644 --- a/InvenTree/order/urls.py +++ b/InvenTree/order/urls.py @@ -42,10 +42,6 @@ sales_order_detail_urls = [ url(r'^cancel/', views.SalesOrderCancel.as_view(), name='so-cancel'), url(r'^ship/', views.SalesOrderShip.as_view(), name='so-ship'), - url(r'^builds/', views.SalesOrderDetail.as_view(template_name='order/so_builds.html'), name='so-builds'), - url(r'^attachments/', views.SalesOrderDetail.as_view(template_name='order/so_attachments.html'), name='so-attachments'), - url(r'^notes/', views.SalesOrderNotes.as_view(), name='so-notes'), - url(r'^.*$', views.SalesOrderDetail.as_view(), name='so-detail'), ] diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 2ec06e600e..7267df1094 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -122,28 +122,6 @@ class PurchaseOrderNotes(InvenTreeRoleMixin, UpdateView): return ctx -class SalesOrderNotes(InvenTreeRoleMixin, UpdateView): - """ View for editing the 'notes' field of a SalesORder """ - - context_object_name = 'order' - template_name = 'order/sales_order_notes.html' - model = SalesOrder - role_required = 'sales_order.view' - - fields = ['notes'] - - def get_success_url(self): - return reverse('so-notes', kwargs={'pk': self.get_object().pk}) - - def get_context_data(self, **kwargs): - - ctx = super().get_context_data(**kwargs) - - ctx['editing'] = str2bool(self.request.GET.get('edit', False)) - - return ctx - - class PurchaseOrderCancel(AjaxUpdateView): """ View for cancelling a purchase order """