diff --git a/InvenTree/build/templates/build/allocation_item.html b/InvenTree/build/templates/build/allocation_item.html index 96520008bb..f5af9ef6f4 100644 --- a/InvenTree/build/templates/build/allocation_item.html +++ b/InvenTree/build/templates/build/allocation_item.html @@ -25,7 +25,7 @@ Allocated:
- 0 + {% part_allocation_count build item.sub_part %}
diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index c06854227c..b17c5bf9e8 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -14,6 +14,13 @@ def multiply(x, y, *args, **kwargs): return x * y +@register.simple_tag() +def part_allocation_count(build, part, *args, **kwargs): + """ Return the total number of allocated to """ + + return build.getAllocatedQuantity(part) + + @register.simple_tag() def inventree_version(*args, **kwargs): """ Return InvenTree version string """