From bbe66472ee44e2878c1cb5a14259f01836d165d3 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 25 May 2019 23:40:59 +1000 Subject: [PATCH] Display list of part variants --- InvenTree/part/templates/part/tabs.html | 2 +- InvenTree/part/templates/part/variants.html | 47 ++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/templates/part/tabs.html b/InvenTree/part/templates/part/tabs.html index 855462c217..a251c840de 100644 --- a/InvenTree/part/templates/part/tabs.html +++ b/InvenTree/part/templates/part/tabs.html @@ -25,7 +25,7 @@ Used In{% if part.used_in_count > 0 %}{{ part.used_in_count }}{% endif %} {% endif %} - {% if part.purchaseable %} + {% if part.purchaseable and part.has_variants == False %} Suppliers {{ part.supplier_count }} diff --git a/InvenTree/part/templates/part/variants.html b/InvenTree/part/templates/part/variants.html index dd8effcc29..72427ca19c 100644 --- a/InvenTree/part/templates/part/variants.html +++ b/InvenTree/part/templates/part/variants.html @@ -4,6 +4,51 @@ {% block details %} {% include "part/tabs.html" with tab='variants' %} -TODO +
+
+

Part Variants

+
+
+
+
+
+ + + + + + + + + + + {% for variant in part.variants.all %} + + + + + + {% endfor %} + +
VariantDescriptionStock
+
+ + {% if variant.image %} + + {% endif %} +
+ {{ variant.full_name }}
{{ variant.description }}{{ variant.total_stock }}
+ +{% endblock %} + + +{% block js_ready %} +{{ block.super }} + + + $('#variant-table').bootstrapTable({ + search: true, + sortable: true, + }); {% endblock %} \ No newline at end of file