2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 20:46:47 +00:00

Set null location on stock item: (#8565)

- When consumed by a build order
- When shipped to a customer
This commit is contained in:
Oliver 2024-11-26 20:29:37 +11:00 committed by GitHub
parent 7b1b476851
commit 9d2ca5e617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -1750,6 +1750,7 @@ class BuildItem(InvenTree.models.InvenTreeMetadataModel):
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(

View File

@ -1403,6 +1403,7 @@ class StockItem(
# 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}