From 62734c4b7298fc1da248d644890ca225c64728a1 Mon Sep 17 00:00:00 2001
From: Oliver Walters
Date: Mon, 5 Oct 2020 00:01:01 +1100
Subject: [PATCH] Add a custom template for the install item form
---
.../stock/templates/stock/item_install.html | 17 +++++++++++++++++
.../stock/templates/stock/item_serialize.html | 6 ++++--
InvenTree/stock/views.py | 1 +
InvenTree/templates/js/stock.html | 7 ++++---
4 files changed, 26 insertions(+), 5 deletions(-)
create mode 100644 InvenTree/stock/templates/stock/item_install.html
diff --git a/InvenTree/stock/templates/stock/item_install.html b/InvenTree/stock/templates/stock/item_install.html
new file mode 100644
index 0000000000..04798972d2
--- /dev/null
+++ b/InvenTree/stock/templates/stock/item_install.html
@@ -0,0 +1,17 @@
+{% extends "modal_form.html" %}
+{% load i18n %}
+
+{% block pre_form_content %}
+
+
+ {% trans "Install another StockItem into this item." %}
+
+
+ {% trans "Stock items can only be installed if they meet the following criteria" %}:
+
+
+ - {% trans "The StockItem links to a Part which is in the BOM for this StockItem" %}
+ - {% trans "The StockItem is currently in stock" %}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/stock/templates/stock/item_serialize.html b/InvenTree/stock/templates/stock/item_serialize.html
index bb0054cca2..0f70647e38 100644
--- a/InvenTree/stock/templates/stock/item_serialize.html
+++ b/InvenTree/stock/templates/stock/item_serialize.html
@@ -1,6 +1,8 @@
{% extends "modal_form.html" %}
+{% load i18n %}
{% block pre_form_content %}
-Create serialized items from this stock item.
-Select quantity to serialize, and unique serial numbers.
+{% trans "Create serialized items from this stock item." %}
+
+{% trans "Select quantity to serialize, and unique serial numbers." %}
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py
index 860ef0c74b..9d078bf702 100644
--- a/InvenTree/stock/views.py
+++ b/InvenTree/stock/views.py
@@ -698,6 +698,7 @@ class StockItemInstall(AjaxUpdateView):
model = StockItem
form_class = StockForms.InstallStockForm
ajax_form_title = _('Install Stock Item')
+ ajax_template_name = "stock/item_install.html"
part = None
diff --git a/InvenTree/templates/js/stock.html b/InvenTree/templates/js/stock.html
index 0ebedbfb6e..eb5e4adbf7 100644
--- a/InvenTree/templates/js/stock.html
+++ b/InvenTree/templates/js/stock.html
@@ -899,9 +899,6 @@ function loadInstalledInTable(table, options) {
var pk = subrow.pk;
var html = '';
- html += row.sub_part_detail.full_name;
- html += " | ";
-
if (subrow.serial && subrow.quantity == 1) {
html += `{% trans "Serial" %}: ${subrow.serial}`;
} else {
@@ -918,6 +915,10 @@ function loadInstalledInTable(table, options) {
return stockStatusDisplay(value);
}
},
+ {
+ field: 'batch',
+ title: '{% trans "Batch" %}',
+ },
{
field: 'actions',
title: '',