aboutsummaryrefslogtreecommitdiffstats
path: root/servo/templates/products
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-11-25 23:04:36 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-11-25 23:04:36 +0200
commitb299a35443a70c8262fd0ec49d8fddb4fe73f7eb (patch)
tree2844afc09482dd6f421968723485f13fb0195cb6 /servo/templates/products
parent56fd7e2f80e0c91850abb5ca2f7227f101994d69 (diff)
downloadServo-b299a35443a70c8262fd0ec49d8fddb4fe73f7eb.tar.gz
Servo-b299a35443a70c8262fd0ec49d8fddb4fe73f7eb.tar.bz2
Servo-b299a35443a70c8262fd0ec49d8fddb4fe73f7eb.zip
Performance fix for detail view
Diffstat (limited to 'servo/templates/products')
-rwxr-xr-xservo/templates/products/view.html10
1 files changed, 5 insertions, 5 deletions
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 @@
<th>{% trans "Dispatched" %}</th>
</tr>
</thead>
- {% for i in product.serviceorderitem_set.all reversed %}
+ {% for i in sales %}
<tr>
{% with i.order as order %}
<td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
@@ -159,14 +159,14 @@
</tr>
</thead>
<tbody>
- {% for i in product.purchaseorderitem_set.all reversed %}
+ {% for i in purchases %}
<tr>
- {% with i.purchase_order as order %}
+ {% with i.purchase_order as order %}
<td><a href="{{ order.get_absolute_url }}">{{ order.pk|safe }}</a></td>
<td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
<td>{{ i.price|currency }}</td>
<td>{{ i.received_at|date:"SHORT_DATE_FORMAT" }}</td>
- {% endwith %}
+ {% endwith %}
</tr>
{% empty %}
<tr><td colspan="4" class="empty muted">{% trans "No Purchase Orders" %}</td></tr>
@@ -185,7 +185,7 @@
</tr>
</thead>
<tbody>
- {% for i in product.invoiceitem_set.all reversed %}
+ {% for i in invoices %}
<tr>
<td><a href="{{ i.invoice.get_absolute_url }}">{{ i.invoice.pk|safe }}</a></td>
{% with i.invoice.order as order %}