diff --git a/InvenTree/order/templates/order/po_attachments.html b/InvenTree/order/templates/order/po_attachments.html new file mode 100644 index 0000000000..2e2e696833 --- /dev/null +++ b/InvenTree/order/templates/order/po_attachments.html @@ -0,0 +1,73 @@ +{% extends "order/order_base.html" %} + +{% load inventree_extras %} +{% load i18n %} +{% load static %} + +{% block details %} + +{% include 'order/tabs.html' with tab='attachments' %} + +

{% trans "Purchase Order Attachments" %} + +
+ +
+
+ +
+
+ + + + + + + + + + + {% for attachment in order.attachments.all %} + + + + + + {% endfor %} + +
{% trans "File" %}{% trans "Comment" %}
{{ attachment.basename }}{{ attachment.comment }} +
+ + +
+
+ +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +$("#new-attachment").click(function() { + +}); + +$("#attachment-table").on('click', '.attachment-edit-button', function() { + var button = $(this); + + // TODO +}); + +$("#attachment-table").on('click', '.attachment-delete-button', function() { + var button = $(this); + + // TODO +}); + +$("#attachment-table").inventreeTable({ +}); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/tabs.html b/InvenTree/order/templates/order/tabs.html index e673a3271e..f98822c769 100644 --- a/InvenTree/order/templates/order/tabs.html +++ b/InvenTree/order/templates/order/tabs.html @@ -4,6 +4,9 @@ {% trans "Items" %} + + {% trans "Attachments" %} + {% trans "Notes" %}{% if order.notes %} {% endif %} diff --git a/InvenTree/order/urls.py b/InvenTree/order/urls.py index d1d7d7f5f7..e663dacba8 100644 --- a/InvenTree/order/urls.py +++ b/InvenTree/order/urls.py @@ -21,6 +21,7 @@ purchase_order_detail_urls = [ url(r'^notes/', views.PurchaseOrderNotes.as_view(), name='purchase-order-notes'), + url(r'^attachments/', views.PurchaseOrderDetail.as_view(template_name='order/po_attachments.html'), name='purchase-order-attachments'), url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='purchase-order-detail'), ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 427cf4dcea..4e579ea44c 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -942,6 +942,9 @@ def attach_file(instance, filename): class PartAttachment(InvenTreeAttachment): + """ + Model for storing file attachments against a Part object + """ def getSubdir(self): return os.path.join("part_files", str(self.part.id))