mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
- Allocation check only applies to untracked line items
(cherry picked from commit 1f81daadf6
)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
eab3fdcf2c
commit
4c41a50bb1
@ -630,7 +630,7 @@ class BuildCompleteSerializer(serializers.Serializer):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'overallocated': build.is_overallocated(),
|
'overallocated': build.is_overallocated(),
|
||||||
'allocated': build.is_fully_allocated(),
|
'allocated': build.are_untracked_parts_allocated,
|
||||||
'remaining': build.remaining,
|
'remaining': build.remaining,
|
||||||
'incomplete': build.incomplete_count,
|
'incomplete': build.incomplete_count,
|
||||||
}
|
}
|
||||||
@ -663,7 +663,7 @@ class BuildCompleteSerializer(serializers.Serializer):
|
|||||||
"""Check if the 'accept_unallocated' field is required"""
|
"""Check if the 'accept_unallocated' field is required"""
|
||||||
build = self.context['build']
|
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'))
|
raise ValidationError(_('Required stock has not been fully allocated'))
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
Loading…
Reference in New Issue
Block a user