From b299a35443a70c8262fd0ec49d8fddb4fe73f7eb Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 25 Nov 2015 23:04:36 +0200 Subject: Performance fix for detail view --- servo/templates/products/view.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'servo/templates') diff --git a/servo/templates/products/view.html b/servo/templates/products/view.html index f719ed5..589e7f1 100755 --- a/servo/templates/products/view.html +++ b/servo/templates/products/view.html @@ -133,7 +133,7 @@ {% trans "Dispatched" %} - {% for i in product.serviceorderitem_set.all reversed %} + {% for i in sales %} {% with i.order as order %} {{ order.code }} @@ -159,14 +159,14 @@ - {% for i in product.purchaseorderitem_set.all reversed %} + {% for i in purchases %} - {% with i.purchase_order as order %} + {% with i.purchase_order as order %} {{ order.pk|safe }} {{ i.created_at|date:"SHORT_DATE_FORMAT" }} {{ i.price|currency }} {{ i.received_at|date:"SHORT_DATE_FORMAT" }} - {% endwith %} + {% endwith %} {% empty %} {% trans "No Purchase Orders" %} @@ -185,7 +185,7 @@ - {% for i in product.invoiceitem_set.all reversed %} + {% for i in invoices %} {{ i.invoice.pk|safe }} {% with i.invoice.order as order %} -- cgit v1.2.3