mirror of
https://github.com/inventree/InvenTree.git
synced 2026-01-28 09:03:41 +00:00
[bug] build output stock status (#11126)
- Ensure custom status is correctly set when completing build output - Closes https://github.com/inventree/InvenTree/issues/11119
This commit is contained in:
@@ -1254,7 +1254,9 @@ class Build(
|
|||||||
output.build = self
|
output.build = self
|
||||||
output.is_building = False
|
output.is_building = False
|
||||||
output.location = location
|
output.location = location
|
||||||
output.status = status
|
|
||||||
|
# Assign the stock status
|
||||||
|
output.set_status(status)
|
||||||
|
|
||||||
output.save(add_note=False)
|
output.save(add_note=False)
|
||||||
|
|
||||||
|
|||||||
@@ -2910,7 +2910,7 @@ class ReturnOrder(TotalPriceMixin, Order):
|
|||||||
line.item = stock_item
|
line.item = stock_item
|
||||||
line.save()
|
line.save()
|
||||||
|
|
||||||
status = kwargs.get('status')
|
status = kwargs.get('status', StockStatus.QUARANTINED.value)
|
||||||
|
|
||||||
if status is None:
|
if status is None:
|
||||||
status = StockStatus.QUARANTINED.value
|
status = StockStatus.QUARANTINED.value
|
||||||
@@ -2921,7 +2921,7 @@ class ReturnOrder(TotalPriceMixin, Order):
|
|||||||
deltas['customer'] = stock_item.customer.pk
|
deltas['customer'] = stock_item.customer.pk
|
||||||
|
|
||||||
# Update the StockItem
|
# Update the StockItem
|
||||||
stock_item.status = status
|
stock_item.set_status(status)
|
||||||
stock_item.location = location
|
stock_item.location = location
|
||||||
stock_item.customer = None
|
stock_item.customer = None
|
||||||
stock_item.sales_order = None
|
stock_item.sales_order = None
|
||||||
|
|||||||
Reference in New Issue
Block a user