From 4c41a50bb1b6138f6ce57feb1f903dbff5c40268 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:48:18 +1000 Subject: [PATCH] Fix allocation check for completing build order (#5199) (#5200) - Allocation check only applies to untracked line items (cherry picked from commit 1f81daadf6c029afb5ee0ee51e3bcd6d40adacd3) Co-authored-by: Oliver --- InvenTree/build/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index 4ea3a1bb18..97fd8d1c47 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -630,7 +630,7 @@ class BuildCompleteSerializer(serializers.Serializer): return { 'overallocated': build.is_overallocated(), - 'allocated': build.is_fully_allocated(), + 'allocated': build.are_untracked_parts_allocated, 'remaining': build.remaining, 'incomplete': build.incomplete_count, } @@ -663,7 +663,7 @@ class BuildCompleteSerializer(serializers.Serializer): """Check if the 'accept_unallocated' field is required""" build = self.context['build'] - if not build.is_fully_allocated() and not value: + if not build.are_untracked_parts_allocated and not value: raise ValidationError(_('Required stock has not been fully allocated')) return value