2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 21:20:56 +00:00

remove from stock now works

This commit is contained in:
Oliver Walters
2019-06-02 12:15:44 +10:00
parent 1b3ffada6d
commit d365d7cc44
3 changed files with 5 additions and 6 deletions

View File

@ -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))