From 2429bc219294299f9adba0525707976ee9f5c8bf Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 6 Feb 2026 17:46:24 +1100 Subject: [PATCH] [build] Check for allocated items which are in production (#11263) --- src/backend/InvenTree/build/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/InvenTree/build/models.py b/src/backend/InvenTree/build/models.py index 4834e8b1e0..03219f62a4 100644 --- a/src/backend/InvenTree/build/models.py +++ b/src/backend/InvenTree/build/models.py @@ -1222,6 +1222,13 @@ class Build( # List the allocated BuildItem objects for the given output allocated_items = output.items_to_install.all() + # Ensure that none of the allocated items are themselves still "in production" + for build_item in allocated_items: + if build_item.stock_item.is_building: + raise ValidationError( + _('Allocated stock items are still in production') + ) + # If a partial quantity is provided, split the stock output if quantity is not None and quantity != output.quantity: # Cannot split a build output with allocated items