mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Stock counting now works
This commit is contained in:
parent
d365d7cc44
commit
2ee35ec062
@ -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() {
|
||||
|
@ -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 """
|
||||
|
@ -8,8 +8,8 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" id='multi-item-add' title='Add to selected stock items'>Add stock</a></li>
|
||||
<li><a href="#" id='multi-item-remove' title='Remove from selected stock items'>Remove stock</a></li>
|
||||
<li><a href="#" id='multi-item-stocktake' title='Stocktake selected stock items'>Stocktake</a></li>
|
||||
<li><a href='#' id='multi-item-move' title='Move selected stock items'>Move</a></li>
|
||||
<li><a href="#" id='multi-item-stocktake' title='Stocktake selected stock items'>Count stock</a></li>
|
||||
<li><a href='#' id='multi-item-move' title='Move selected stock items'>Move stock</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user