diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html
index 3efe9af05e..3f6f41d1c6 100644
--- a/InvenTree/part/templates/part/stock.html
+++ b/InvenTree/part/templates/part/stock.html
@@ -4,19 +4,30 @@
{% include 'part/tabs.html' with tab='stock' %}
-
Part Stock
-
+
-
+
+
+
+
+
+
+
+
+
@@ -25,6 +36,8 @@
{% block js_load %}
{{ block.super }}
+
+
{% endblock %}
{% block js_ready %}
{{ block.super }}
@@ -43,6 +56,7 @@
$("#stock-table").bootstrapTable({
sortable: true,
search: true,
+ pagination: true,
queryParams: function(p) {
return {
part: {{ part.id }},
@@ -79,4 +93,39 @@
url: "{% url 'api-stock-list' %}"
});
+ function selectedStock() {
+ return $("#stock-table").bootstrapTable('getSelections');
+ }
+
+ $("#multi-item-move").click(function() {
+
+ var items = selectedStock();
+
+ moveStockItems(items,
+ {
+ success: function() {
+ $("#stock-table").bootstrapTable('refresh');
+ }
+ });
+
+ return false;
+ });
+
+ $("#multi-item-delete").click(function() {
+
+ var items = selectedStock();
+
+ deleteStockItems(items, {});
+
+ return false;
+ });
+
+ $("#multi-item-stocktake").click(function() {
+ var items = selectedStock();
+
+ countStockItems(items, {});
+
+ return false;
+ });
+
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js
index 4bca89e4a0..55e9f2d423 100644
--- a/InvenTree/static/script/inventree/stock.js
+++ b/InvenTree/static/script/inventree/stock.js
@@ -85,6 +85,22 @@ function moveStockItems(items, options) {
});
}
+function countStockItems(items, options) {
+ var modal = '#modal-form';
+
+ if ('modal' in options) {
+ modal = options.modal;
+ }
+
+ if (items.length == 0) {
+ alert('No stock items selected');
+ return;
+ }
+
+ openModal(modal);
+ modalSetTitle(modal, 'Stocktake');
+}
+
function deleteStockItems(items, options) {
var modal = '#modal-delete';
diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html
index d5df1a0715..43b7cebb8f 100644
--- a/InvenTree/stock/templates/stock/location.html
+++ b/InvenTree/stock/templates/stock/location.html
@@ -148,7 +148,7 @@
$("#multi-item-stocktake").click(function() {
var items = selectedStock();
- alert('Stocktake on ' + items.length + ' items');
+ countStockItems(items, {});
return false;
});