From 66b60368274d097b76765d6e4cd914b56fc54d33 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 25 Apr 2020 13:29:18 +1000 Subject: [PATCH] Add two new "build orders" tab to the "sales order" view --- .../static/script/inventree/filters.js | 4 --- .../order/templates/order/so_builds.html | 30 +++++++++++++++++++ InvenTree/order/templates/order/so_tabs.html | 10 ++++++- InvenTree/order/urls.py | 1 + 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 InvenTree/order/templates/order/so_builds.html diff --git a/InvenTree/InvenTree/static/script/inventree/filters.js b/InvenTree/InvenTree/static/script/inventree/filters.js index b29e787e18..8c9ebbec6d 100644 --- a/InvenTree/InvenTree/static/script/inventree/filters.js +++ b/InvenTree/InvenTree/static/script/inventree/filters.js @@ -260,8 +260,6 @@ function setupFilterList(tableKey, table, target) { var element = $(target); - console.log(tableKey + " - " + element); - // One blank slate, please element.empty(); @@ -302,8 +300,6 @@ function setupFilterList(tableKey, table, target) { element.find(`#filter-tag-${tableKey}`).on('change', function() { var list = element.find(`#filter-value-${tableKey}`); - console.log('index was changed!'); - list.replaceWith(generateFilterInput(tableKey, this.value)); }); diff --git a/InvenTree/order/templates/order/so_builds.html b/InvenTree/order/templates/order/so_builds.html new file mode 100644 index 0000000000..f877a4977f --- /dev/null +++ b/InvenTree/order/templates/order/so_builds.html @@ -0,0 +1,30 @@ +{% extends "order/sales_order_base.html" %} + +{% load inventree_extras %} +{% load i18n %} +{% load static %} + +{% block details %} + +{% include 'order/so_tabs.html' with tab='builds' %} + +

{% trans "Build Orders" %}

+
+ +
+ +{% endblock %} + +{% block js_ready %} + +{{ block.super }} + +loadBuildTable($("#builds-table"), { + url: "{% url 'api-build-list' %}", + params: { + sales_order: {{ order.id }}, + part_detail: true, + }, +}); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_tabs.html b/InvenTree/order/templates/order/so_tabs.html index fbb931d8a2..cb3740a073 100644 --- a/InvenTree/order/templates/order/so_tabs.html +++ b/InvenTree/order/templates/order/so_tabs.html @@ -2,7 +2,15 @@