diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index 0f2ee43136..84557535ba 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -564,10 +564,7 @@ function loadStockTable(table, options) { // Automatically link button callbacks $('#multi-item-stocktake').click(function() { - updateStockItems({ - action: 'stocktake', - }); - return false; + stockAdjustment('count'); }); $('#multi-item-remove').click(function() { diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index a5662e8d6e..b9981f26de 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -358,7 +358,17 @@ class StockAdjust(AjaxView, FormMixin): return _("Removed stock from {n} items".format(n=count)) def do_count(self): - pass + + count = 0 + note = self.request.POST['note'] + + for item in self.stock_items: + + item.stocktake(item.new_quantity, self.request.user, notes=note) + + count += 1 + + return _("Counted stock for {n} items".format(n=count)) def do_move(self, destination): """ Perform actual stock movement """ diff --git a/InvenTree/templates/stock_table.html b/InvenTree/templates/stock_table.html index fae7b04214..acdd371d08 100644 --- a/InvenTree/templates/stock_table.html +++ b/InvenTree/templates/stock_table.html @@ -8,8 +8,8 @@