InvenTree/InvenTree/order/templates/order/so_attachments.html

53 lines
1.1 KiB
HTML

{% extends "order/sales_order_base.html" %}
{% load inventree_extras %}
{% load i18n %}
{% load static %}
{% block details %}
{% include 'order/so_tabs.html' with tab='attachments' %}
<h4>{% trans "Sales Order Attachments" %}</h4>
<hr>
{% include "attachment_table.html" with attachments=order.attachments.all %}
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#new-attachment").click(function() {
launchModalForm("{% url 'so-attachment-create' %}?order={{ order.id }}",
{
reload: true,
}
);
});
$("#attachment-table").on('click', '.attachment-edit-button', function() {
var button = $(this);
var url = `/order/sales-order/attachment/${button.attr('pk')}/edit/`;
launchModalForm(url, {
reload: true,
});
});
$("#attachment-table").on('click', '.attachment-delete-button', function() {
var button = $(this);
var url = `/order/sales-order/attachment/${button.attr('pk')}/delete/`;
launchModalForm(url, {
reload: true,
});
});
$("#attachment-table").inventreeTable({
});
{% endblock %}