diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html index a9a59d9d7f..c6645108c1 100644 --- a/InvenTree/part/templates/part/stock.html +++ b/InvenTree/part/templates/part/stock.html @@ -6,50 +6,8 @@

Part Stock

- - - - - {% if part.trackable %} - - {% else %} - - {% endif %} - - - - - - - -{% for stock in part.stock_entries %} - - - - - - - - -{% endfor %} - -
LinkSerial NumberQuantityLocationSupplier partStocktakeNotes
Click - {% if part.trackable %} - {{ stock.serial }} - {% else %} - {{ stock.quantity }} - {% endif %} - - {% if stock.location %} - {{ stock.location.name }} - {% endif %} - - {% if stock.supplier_part %} - - {{ stock.supplier_part.supplier.name }} | {{ stock.supplier_part.SKU }} - - {% endif %} - {% if stock.stocktake_date %}{{ stock.stocktake_date }}{% endif %}{{ stock.notes }}
+
@@ -62,7 +20,7 @@ {% endblock %} {% block js_ready %} {{ block.super }} - + $('#add-stock-item').click(function () { launchModalForm("#modal-form", "{% url 'stock-item-create' %}", @@ -73,4 +31,41 @@ } }); }); + + $("#stock-table").bootstrapTable({ + sortable: true, + search: true, + queryParams: function(p) { + return { + part: {{ part.id }}, + in_stock: true, + } + }, + columns: [ + { + field: 'pk', + title: 'ID', + visible: false, + }, + { + checkbox: true, + }, + { + field: 'location', + title: 'Location', + sortable: true, + formatter: function(value, row, index, field){ + return renderLink(value.pathstring, value.url); + } + }, + { + field: 'quantity', + title: 'Stock', + searchable: false, + sortable: true, + } + ], + url: "{% url 'api-stock-list' %}" + }); + {% endblock %} \ No newline at end of file