mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Pre-fill allocation count
This commit is contained in:
parent
34d1ef7d8d
commit
a95e77c429
@ -25,7 +25,7 @@
|
||||
Allocated:
|
||||
</div>
|
||||
<div class='col-sm-1' id='allocation-panel-{{ item.sub_part.id }}'>
|
||||
<b><span id='allocation-total-{{ item.sub_part.id }}'>0</span></b>
|
||||
<b><span id='allocation-total-{{ item.sub_part.id }}'>{% part_allocation_count build item.sub_part %}</span></b>
|
||||
</div>
|
||||
<div class='col-sm-2'>
|
||||
<div class='btn-group' style='float: right;'>
|
||||
|
@ -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 <part> allocated to <build> """
|
||||
|
||||
return build.getAllocatedQuantity(part)
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_version(*args, **kwargs):
|
||||
""" Return InvenTree version string """
|
||||
|
Loading…
Reference in New Issue
Block a user