mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +00:00
Refactoring Build model functions
- Determining if a build order is correctly allocated has become more complex - Complex BOM behaviours (e.g. variants, templates, and substitutes) have made it more difficult! - Recently, a reference to the defining BomItem object was added to the BuildItem model - Now, a simpler way is to check allocation against the parent BomItem - It is much better, but means that a lot of refactoring and testing will be required!
This commit is contained in:
@ -160,7 +160,7 @@ class BuildOutputSerializer(serializers.Serializer):
|
||||
if to_complete:
|
||||
|
||||
# The build output must have all tracked parts allocated
|
||||
if not build.isFullyAllocated(output):
|
||||
if not build.is_fully_allocated(output):
|
||||
raise ValidationError(_("This build output is not fully allocated"))
|
||||
|
||||
return output
|
||||
@ -436,7 +436,7 @@ class BuildCompleteSerializer(serializers.Serializer):
|
||||
|
||||
build = self.context['build']
|
||||
|
||||
if not build.areUntrackedPartsFullyAllocated() and not value:
|
||||
if not build.are_untracked_parts_allocated() and not value:
|
||||
raise ValidationError(_('Required stock has not been fully allocated'))
|
||||
|
||||
return value
|
||||
|
Reference in New Issue
Block a user