Add 'on_order' quantity to the part list API

This commit is contained in:
Oliver Walters 2020-03-26 14:46:23 +11:00
parent d0f71ea6de
commit dae45875fb

View File

@ -172,6 +172,7 @@ class PartList(generics.ListCreateAPIView):
'active', 'active',
).annotate( ).annotate(
in_stock=Sum('stock_items__quantity'), in_stock=Sum('stock_items__quantity'),
on_order=Sum('supplier_parts__purchase_order_line_items__quantity'),
) )
# TODO - Annotate total being built # TODO - Annotate total being built