2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-13 06:01:35 +00:00

Handle null line items (#10217)

This commit is contained in:
Oliver
2025-08-25 13:30:40 +10:00
committed by GitHub
parent a9f10f191c
commit ea667c1f62

View File

@@ -1402,6 +1402,9 @@ class Part(
for bom_item in bom_items:
build_line = build.build_lines.filter(bom_item=bom_item).first()
if not build_line:
continue
line_quantity = max(0, build_line.quantity - build_line.consumed)
quantity += line_quantity
@@ -1450,6 +1453,10 @@ class Part(
for line in open_lines:
# Determine the quantity "remaining" to be shipped out
if not line:
continue
remaining = max(line.quantity - line.shipped, 0)
quantity += remaining