Add a custom template for the install item form

This commit is contained in:
Oliver Walters 2020-10-05 00:01:01 +11:00
parent 3fe0886207
commit 62734c4b72
4 changed files with 26 additions and 5 deletions

View File

@ -0,0 +1,17 @@
{% extends "modal_form.html" %}
{% load i18n %}
{% block pre_form_content %}
<p>
{% trans "Install another StockItem into this item." %}
</p>
<p>
{% trans "Stock items can only be installed if they meet the following criteria" %}:
<ul>
<li>{% trans "The StockItem links to a Part which is in the BOM for this StockItem" %}</li>
<li>{% trans "The StockItem is currently in stock" %}</li>
</ul>
</p>
{% endblock %}

View File

@ -1,6 +1,8 @@
{% extends "modal_form.html" %}
{% load i18n %}
{% block pre_form_content %}
Create serialized items from this stock item.<br>
Select quantity to serialize, and unique serial numbers.
{% trans "Create serialized items from this stock item." %}
<br>
{% trans "Select quantity to serialize, and unique serial numbers." %}
{% endblock %}

View File

@ -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

View File

@ -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: '',