Skip to content

Commit

Permalink
Set null location on stock item:
Browse files Browse the repository at this point in the history
- When consumed by a build order
- When shipped to a customer
  • Loading branch information
SchrodingersGat committed Nov 26, 2024
1 parent ee9980e commit 43d64ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/InvenTree/build/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@ def complete_allocation(self, user, notes=''):
else:
# Mark the item as "consumed" by the build order
item.consumed_by = self.build
item.location = None
item.save(add_note=False)

item.add_tracking_entry(
Expand Down
1 change: 1 addition & 0 deletions src/backend/InvenTree/stock/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,7 @@ def installStockItem(self, other_item, quantity, user, notes, build=None):
# Assign the other stock item into this one
stock_item.belongs_to = self
stock_item.consumed_by = build
stock_item.location = None
stock_item.save(add_note=False)

deltas = {'stockitem': self.pk}
Expand Down

0 comments on commit 43d64ae

Please sign in to comment.