From 60cde7fe131bb64238c0fc2fa985a401419a1cc5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 27 Jan 2022 15:01:26 +1100 Subject: [PATCH] Includes sales order allocation data --- InvenTree/templates/js/translated/stock.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index f0819908dc..d37bb25e26 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -2249,8 +2249,17 @@ function loadStockAllocationTable(table, options={}) { sidePagination: 'client', showColumns: false, onLoadSuccess: function(tableData) { - // TODO - console.log("onLoadSuccess"); + + var query_params = params; + query_params.order_detail = true; + + // Load sales order allocation data + inventreeGet('{% url "api-so-allocation-list" %}', query_params, { + success: function(data) { + // Update table to include sales order data + $(table).bootstrapTable('append', data); + } + }); }, columns: [ { @@ -2288,7 +2297,7 @@ function loadStockAllocationTable(table, options={}) { if (row.build) { return buildStatusDisplay(row.build_detail.status); } else if (row.order) { - return 'order status'; + return salesOrderStatusDisplay(row.order_detail.status); } else { return '-'; }