mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
prefetching related information
This commit is contained in:
parent
4156b71c4b
commit
71c3ff4b9f
@ -2043,7 +2043,8 @@ class PartPricing(AjaxView):
|
|||||||
# Stock history
|
# Stock history
|
||||||
if part_settings.part_show_graph and part.total_stock > 1:
|
if part_settings.part_show_graph and part.total_stock > 1:
|
||||||
ret = []
|
ret = []
|
||||||
stock = part.stock_entries(include_variants=False, in_stock=True)
|
stock = part.stock_entries(include_variants=False, in_stock=True) #.order_by('purchase_order__date')
|
||||||
|
stock = stock.prefetch_related('purchase_order', 'supplier_part')
|
||||||
|
|
||||||
for stock_item in stock:
|
for stock_item in stock:
|
||||||
if None in [stock_item.purchase_price, stock_item.quantity]:
|
if None in [stock_item.purchase_price, stock_item.quantity]:
|
||||||
|
Loading…
Reference in New Issue
Block a user