2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Add stock tracking code to indicate stock has been consumed by a build order

This commit is contained in:
Oliver
2022-02-25 15:56:09 +11:00
parent bb164ed72a
commit 9e3406efc9
3 changed files with 15 additions and 4 deletions

View File

@ -1530,7 +1530,7 @@ class StockItem(MPTTModel):
return True
@transaction.atomic
def take_stock(self, quantity, user, notes=''):
def take_stock(self, quantity, user, notes='', code=StockHistoryCode.STOCK_REMOVE):
"""
Remove items from stock
"""
@ -1550,7 +1550,7 @@ class StockItem(MPTTModel):
if self.updateQuantity(self.quantity - quantity):
self.add_tracking_entry(
StockHistoryCode.STOCK_REMOVE,
code,
user,
notes=notes,
deltas={