From ea466c358895ccbf9ffd6e8f10adf41f3d36bc0d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 13 Apr 2020 20:01:19 +1000 Subject: [PATCH] More cleanup - Allow user filtering for purchase-order table in part view - Remove some debug strings --- InvenTree/InvenTree/static/script/inventree/filters.js | 6 ------ InvenTree/InvenTree/static/script/inventree/order.js | 2 +- .../company/templates/company/detail_purchase_orders.html | 5 +---- InvenTree/order/templates/order/purchase_orders.html | 5 +---- InvenTree/part/templates/part/orders.html | 5 ++++- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/InvenTree/InvenTree/static/script/inventree/filters.js b/InvenTree/InvenTree/static/script/inventree/filters.js index 818cf747c7..de04bcd86d 100644 --- a/InvenTree/InvenTree/static/script/inventree/filters.js +++ b/InvenTree/InvenTree/static/script/inventree/filters.js @@ -73,8 +73,6 @@ function saveTableFilters(tableKey, filters) { var filterstring = strings.join('&'); - console.log(`Saving filters for table '${tableKey}' - ${filterstring}`); - inventreeSave(lookup, filterstring); } @@ -256,12 +254,8 @@ function setupFilterList(tableKey, table, target) { var clear = `filter-clear-${tableKey}`; var make = `filter-make-${tableKey}`; - console.log(`Generating filter list: ${tableKey}`); - var filters = loadTableFilters(tableKey); - console.log("Filters: " + filters.count); - var element = $(target); // One blank slate, please diff --git a/InvenTree/InvenTree/static/script/inventree/order.js b/InvenTree/InvenTree/static/script/inventree/order.js index f0d2663b32..12b2fd4333 100644 --- a/InvenTree/InvenTree/static/script/inventree/order.js +++ b/InvenTree/InvenTree/static/script/inventree/order.js @@ -114,7 +114,7 @@ function loadPurchaseOrderTable(table, options) { setupFilterList("order", table); - table.inventreeTable({ + $(table).inventreeTable({ url: options.url, queryParams: filters, groupBy: false, diff --git a/InvenTree/company/templates/company/detail_purchase_orders.html b/InvenTree/company/templates/company/detail_purchase_orders.html index 7113297b0c..c83bb90eb1 100644 --- a/InvenTree/company/templates/company/detail_purchase_orders.html +++ b/InvenTree/company/templates/company/detail_purchase_orders.html @@ -25,7 +25,7 @@ {% block js_ready %} {{ block.super }} - loadPurchaseOrderTable($("#purchase-order-table"), { + loadPurchaseOrderTable("#purchase-order-table", { url: "{% url 'api-po-list' %}?supplier={{ company.id }}", }); @@ -48,7 +48,4 @@ newOrder(); }); - $(".po-table").inventreeTable({ - }); - {% endblock %} diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index d985b814df..54d57d2d8c 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -37,10 +37,7 @@ $("#po-create").click(function() { ); }); -$("#po-table").inventreeTable({ -}); - -loadPurchaseOrderTable($("#purchase-order-table"), { +loadPurchaseOrderTable("#purchase-order-table", { url: "{% url 'api-po-list' %}", }); diff --git a/InvenTree/part/templates/part/orders.html b/InvenTree/part/templates/part/orders.html index fbb0413e34..d53c6ca04f 100644 --- a/InvenTree/part/templates/part/orders.html +++ b/InvenTree/part/templates/part/orders.html @@ -9,8 +9,11 @@
-
+
+
+ +