2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +00:00

Logic fix for build output creation (#8417)

This commit is contained in:
Oliver 2024-11-03 13:04:55 +11:00 committed by GitHub
parent d1c2213836
commit 546bd945fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -853,8 +853,13 @@ class Build(
if location is None:
location = self.destination or self.part.get_default_location()
if self.part.has_trackable_parts and not serials:
raise ValidationError({
'serials': _("Serial numbers must be provided for trackable parts")
})
# We are generating multiple serialized outputs
if serials or self.part.has_trackable_parts:
if serials:
"""Create multiple build outputs with a single quantity of 1."""
# Create tracking entries for each item