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:
@ -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={
|
||||
|
Reference in New Issue
Block a user