mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
remove from stock now works
This commit is contained in:
parent
1b3ffada6d
commit
d365d7cc44
@ -571,10 +571,7 @@ function loadStockTable(table, options) {
|
||||
});
|
||||
|
||||
$('#multi-item-remove').click(function() {
|
||||
updateStockItems({
|
||||
action: 'remove',
|
||||
});
|
||||
return false;
|
||||
stockAdjustment('take');
|
||||
});
|
||||
|
||||
$('#multi-item-add').click(function() {
|
||||
|
@ -23,7 +23,7 @@
|
||||
<td>
|
||||
<input class='numberinput'
|
||||
min='0'
|
||||
{% if stock_action == 'move' %} max='{{ item.quantity }}' {% endif %}
|
||||
{% if stock_action == 'take' or stock_action == 'move' %} max='{{ item.quantity }}' {% endif %}
|
||||
value='{{ item.new_quantity }}' type='number' name='stock-id-{{ item.id }}' id='stock-id-{{ item.id }}'/>
|
||||
{% if item.error %}
|
||||
<br><span class='help-inline'>{{ item.error }}</span>
|
||||
|
@ -277,7 +277,7 @@ class StockAdjust(AjaxView, FormMixin):
|
||||
valid = False
|
||||
continue
|
||||
|
||||
if self.stock_action in ['move']:
|
||||
if self.stock_action in ['move', 'take']:
|
||||
|
||||
if item.new_quantity > item.quantity:
|
||||
item.error = _('Quantity must not exceed {x}'.format(x=item.quantity))
|
||||
@ -351,6 +351,8 @@ class StockAdjust(AjaxView, FormMixin):
|
||||
if item.new_quantity <= 0:
|
||||
continue
|
||||
|
||||
item.take_stock(item.new_quantity, self.request.user, notes=note)
|
||||
|
||||
count += 1
|
||||
|
||||
return _("Removed stock from {n} items".format(n=count))
|
||||
|
Loading…
Reference in New Issue
Block a user