mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Calculate parts on order for a Part / SupplierPart
This commit is contained in:
@ -806,6 +806,11 @@ class Part(models.Model):
|
||||
|
||||
return orders
|
||||
|
||||
def on_order(self):
|
||||
""" Return the total number of items on order for this part. """
|
||||
|
||||
return sum([part.on_order() for part in self.supplier_parts.all()])
|
||||
|
||||
|
||||
def attach_file(instance, filename):
|
||||
""" Function for storing a file for a PartAttachment
|
||||
|
@ -96,6 +96,12 @@
|
||||
<td>{{ part.allocation_count }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.on_order > 0 %}
|
||||
<tr>
|
||||
<td>On Order</td>
|
||||
<td>{{ part.on_order }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user