From a17ab9bfbdf81b7e2d7227853fa225c67f2d1f02 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 16 May 2020 21:10:27 +1000 Subject: [PATCH] Add an (empty) page for dispalying test results --- .../stock/templates/stock/item_tests.html | 20 +++++++++++++++++++ InvenTree/stock/templates/stock/tabs.html | 8 ++++++++ InvenTree/stock/urls.py | 1 + 3 files changed, 29 insertions(+) create mode 100644 InvenTree/stock/templates/stock/item_tests.html diff --git a/InvenTree/stock/templates/stock/item_tests.html b/InvenTree/stock/templates/stock/item_tests.html new file mode 100644 index 0000000000..e9835f6071 --- /dev/null +++ b/InvenTree/stock/templates/stock/item_tests.html @@ -0,0 +1,20 @@ +{% extends "stock/item_base.html" %} + +{% load static %} +{% load i18n %} + +{% block details %} + +{% include "stock/tabs.html" with tab='tests' %} + +
+

{% trans "Test Results" %}

+ +
+ +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/templates/stock/tabs.html b/InvenTree/stock/templates/stock/tabs.html index fddd2f095f..ce14511b8a 100644 --- a/InvenTree/stock/templates/stock/tabs.html +++ b/InvenTree/stock/templates/stock/tabs.html @@ -10,6 +10,14 @@ {% if item.tracking_info.count > 0 %}{{ item.tracking_info.count }}{% endif %} + {% if item.part.trackable %} + + + {% trans "Test Results" %} + {% if item.test_results.count > 0 %}{{ item.test_results.count }}{% endif %} + + + {% endif %} {% if 0 %} diff --git a/InvenTree/stock/urls.py b/InvenTree/stock/urls.py index 149c0dde2f..f0b3091b84 100644 --- a/InvenTree/stock/urls.py +++ b/InvenTree/stock/urls.py @@ -24,6 +24,7 @@ stock_item_detail_urls = [ url(r'^add_tracking/', views.StockItemTrackingCreate.as_view(), name='stock-tracking-create'), + url(r'^test/', views.StockItemDetail.as_view(template_name='stock/item_tests.html'), name='stock-item-test-results'), url(r'^children/', views.StockItemDetail.as_view(template_name='stock/item_childs.html'), name='stock-item-children'), url(r'^attachments/', views.StockItemDetail.as_view(template_name='stock/item_attachments.html'), name='stock-item-attachments'), url(r'^notes/', views.StockItemNotes.as_view(), name='stock-item-notes'),