mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
@ -67,55 +67,64 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
{% endif %}
|
||||
</h4>
|
||||
|
||||
<div class='btn-group action-buttons'>
|
||||
{% include "qr_button.html" %}
|
||||
<div class='btn-group' role='group'>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class='btn-group action-buttons' role='group'>
|
||||
<!-- Barcode actions menu -->
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
||||
<li class='disabled'><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
||||
{% if item.uid %}
|
||||
<li><a href='#' id='unlink-barcode'><span class='fas fa-unlink'></span> {% trans "Unlink Barcode" %}</a></li>
|
||||
{% else %}
|
||||
<li><a href='#' id='link-barcode'><span class='fas fa-link'></span> {% trans "Link Barcode" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if item.in_stock %}
|
||||
{% if not item.serialized %}
|
||||
<button type='button' class='btn btn-default' id='stock-add' title='{% trans "Add to stock" %}'>
|
||||
<span class='fas fa-plus-circle icon-green'/>
|
||||
</button>
|
||||
<button type='button' class='btn btn-default' id='stock-remove' title='{% trans "Take from stock" %}'>
|
||||
<span class='fas fa-minus-circle icon-red''/>
|
||||
</button>
|
||||
<button type='button' class='btn btn-default' id='stock-count' title='{% trans "Count stock" %}'>
|
||||
<span class='fas fa-clipboard-list'/>
|
||||
</button>
|
||||
{% if item.part.trackable %}
|
||||
<button type='button' class='btn btn-default' id='stock-serialize' title='{% trans "Serialize stock" %}'>
|
||||
<span class='fas fa-hashtag'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if item.part.salable %}
|
||||
<button type='button' class='btn btn-default' id='stock-assign-to-customer' title='{% trans "Assign to Customer" %}'>
|
||||
<span class='fas fa-user-tie'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
<button type='button' class='btn btn-default' id='stock-move' title='{% trans "Transfer stock" %}'>
|
||||
<span class='fas fa-exchange-alt icon-blue'/>
|
||||
</button>
|
||||
<button type='button' class='btn btn-default' id='stock-duplicate' title='{% trans "Duplicate stock item" %}'>
|
||||
<span class='fas fa-copy'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if item.part.has_variants %}
|
||||
<button type='button' class='btn btn-default' id='stock-convert' title='{% trans "Convert stock to variant" %}'>
|
||||
<span class='fas fa-screwdriver'/>
|
||||
</button>
|
||||
<!-- Stock adjustment menu -->
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='stock-options' title='{% trans "Stock adjustment actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
{% if not item.serialized %}
|
||||
<li><a href='#' id='stock-count' title='{% trans "Count stock" %}'><span class='fas fa-clipboard-list'></span> {% trans "Count stock" %}</a></li>
|
||||
<li><a href='#' id='stock-add' title='{% trans "Add stock" %}'><span class='fas fa-plus-circle icon-green'></span> {% trans "Add stock" %}</a></li>
|
||||
<li><a href='#' id='stock-remove' title='{% trans "Remove stock" %}'><span class='fas fa-minus-circle icon-red'></span> {% trans "Remove stock" %}</a></li>
|
||||
{% endif %}
|
||||
<li><a href='#' id='stock-move' title='{% trans "Transfer stock" %}'><span class='fas fa-exchange-alt icon-blue'></span> {% trans "Transfer stock" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- Edit stock item -->
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='stock-edit-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-tools'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
{% if item.part.trackable and not item.serialized %}
|
||||
<li><a href='#' id='stock-serialize' title='{% trans "Serialize stock" %}'><span class='fas fa-hashtag'></span> {% trans "Serialize stock" %}</a> </li>
|
||||
{% endif %}
|
||||
{% if item.part.salable and not item.customer %}
|
||||
<li><a href='#' id='stock-assign-to-customer' title='{% trans "Assign to customer" %}'><span class='fas fa-user-tie'></span> {% trans "Assign to customer" %}</a></li>
|
||||
{% endif %}
|
||||
{% if item.part.has_variants %}
|
||||
<li><a href='#' id='stock-convert' title='{% trans "Convert to variant" %}'><span class='fas fa-screwdriver'></span> {% trans "Convert to variant" %}</a></li>
|
||||
{% endif %}
|
||||
<li><a href='#' id='stock-duplicate' title='{% trans "Duplicate stock item" %}'><span class='fas fa-copy'></span> {% trans "Duplicate stock item" %}</a></li>
|
||||
<li><a href='#' id='stock-edit' title='{% trans "Edit stock item" %}'><span class='fas fa-edit icon-blue'></span> {% trans "Edit stock item" %}</a></li>
|
||||
{% if item.can_delete %}
|
||||
<li><a href='#' id='stock-delete' title='{% trans "Delete stock item" %}'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete stock item" %}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if item.part.has_test_report_templates %}
|
||||
<button type='button' class='btn btn-default' id='stock-test-report' title='{% trans "Generate test report" %}'>
|
||||
<span class='fas fa-tasks'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
<button type='button' class='btn btn-default' id='stock-edit' title='{% trans "Edit stock item" %}'>
|
||||
<span class='fas fa-edit icon-blue'/>
|
||||
</button>
|
||||
{% if item.can_delete %}
|
||||
<button type='button' class='btn btn-default' id='stock-delete' title='{% trans "Delete stock item" %}'>
|
||||
<span class='fas fa-trash-alt icon-red'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@ -131,6 +140,19 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
<a href="{% url 'part-stock' item.part.id %}">{{ item.part.full_name }}
|
||||
</td>
|
||||
</tr>
|
||||
{% if item.serialized %}
|
||||
<tr>
|
||||
<td><span class='fas fa-hashtag'></span></td>
|
||||
<td>{% trans "Serial Number" %}</td>
|
||||
<td>{{ item.serial }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{% trans "Quantity" %}</td>
|
||||
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.customer %}
|
||||
<tr>
|
||||
<td><span class='fas fa-user-tie'></span></td>
|
||||
@ -174,19 +196,6 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
<td>{{ item.uid }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.serialized %}
|
||||
<tr>
|
||||
<td><span class='fas fa-hashtag'></span></td>
|
||||
<td>{% trans "Serial Number" %}</td>
|
||||
<td>{{ item.serial }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{% trans "Quantity" %}</td>
|
||||
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.batch %}
|
||||
<tr>
|
||||
<td></td>
|
||||
@ -330,6 +339,14 @@ $("#show-qr-code").click(function() {
|
||||
});
|
||||
});
|
||||
|
||||
$("#link-barcode").click(function() {
|
||||
linkBarcodeDialog({{ item.id }});
|
||||
});
|
||||
|
||||
$("#unlink-barcode").click(function() {
|
||||
unlinkBarcode({{ item.id }});
|
||||
});
|
||||
|
||||
{% if item.in_stock %}
|
||||
|
||||
{% if item.part.salable %}
|
||||
@ -385,10 +402,11 @@ $('#stock-add').click(function() {
|
||||
|
||||
$("#stock-delete").click(function () {
|
||||
launchModalForm(
|
||||
"{% url 'stock-item-delete' item.id %}",
|
||||
{
|
||||
redirect: "{% url 'part-stock' item.part.id %}"
|
||||
});
|
||||
"{% url 'stock-item-delete' item.id %}",
|
||||
{
|
||||
redirect: "{% url 'part-stock' item.part.id %}"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
{% endblock %}
|
||||
|
@ -12,25 +12,36 @@
|
||||
<h3>{% trans "Stock" %}</h3>
|
||||
<p>{% trans "All stock items" %}</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<div class='btn-group action-buttons'>
|
||||
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||
<span class='fas fa-plus-circle icon-green'/>
|
||||
</button>
|
||||
{% if location %}
|
||||
{% include "qr_button.html" %}
|
||||
<button class='btn btn-default' id='location-count' title='{% trans "Count stock items" %}'>
|
||||
<span class='fas fa-clipboard-list'/>
|
||||
</button>
|
||||
<button class='btn btn-default btn-glyph' id='location-edit' title='{% trans "Edit stock location" %}'>
|
||||
<span class='fas fa-edit icon-blue'/>
|
||||
</button>
|
||||
<button class='btn btn-default btn-glyph' id='location-delete' title='{% trans "Delete stock location" %}'>
|
||||
<span class='fas fa-trash-alt icon-red'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
<div class='btn-group action-buttons' role='group'>
|
||||
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||
<span class='fas fa-plus-circle icon-green'/>
|
||||
</button>
|
||||
<!-- Barcode actions menu -->
|
||||
{% if location %}
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
|
||||
<li class='disabled'><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
|
||||
<li><a href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</p>
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a href='#' id='location-count'><span class='fas fa-clipboard-list'></span>
|
||||
{% trans "Count stock" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='dropdown dropdown-buttons'>
|
||||
<button id='location-actions' title='{% trans "Location actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle="dropdown"><span class='fas fa-sitemap'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
<li><a href='#' id='location-edit'><span class='fas fa-edit icon-green'></span> {% trans "Edit location" %}</a></li>
|
||||
<li><a href='#' id='location-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete location" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
{% if location %}
|
||||
@ -109,6 +120,12 @@
|
||||
inventreeDel('show-part-locs');
|
||||
});
|
||||
|
||||
{% if location %}
|
||||
$("#barcode-check-in").click(function() {
|
||||
barcodeCheckIn({{ location.id }});
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
$("#stock-export").click(function() {
|
||||
launchModalForm("{% url 'stock-export-options' %}", {
|
||||
submit_text: "Export",
|
||||
|
@ -1,7 +1,10 @@
|
||||
{% extends "modal_delete_form.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
Are you sure you want to delete stock location '{{ location.name }}'?
|
||||
{% trans "Are you sure you want to delete this stock location?" %}
|
||||
|
||||
<br>
|
||||
|
||||
@ -33,7 +36,7 @@ If this location is deleted, these items will be moved to the top level 'Stock'
|
||||
|
||||
<ul class='list-group'>
|
||||
{% for item in location.stock_items.all %}
|
||||
<li class='list-group-item'><b>{{ item.part.full_name }}</b> - <i>{{ item.part.description }}</i><span class='badge'>{{ item.quantity }}</span></li>
|
||||
<li class='list-group-item'><b>{{ item.part.full_name }}</b> - <i>{{ item.part.description }}</i><span class='badge'>{% decimal item.quantity %}</span></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
@ -1164,7 +1164,7 @@ class StockItemCreate(AjaxCreateView):
|
||||
try:
|
||||
original = StockItem.objects.get(pk=item_to_copy)
|
||||
initials = model_to_dict(original)
|
||||
self.ajax_form_title = _("Copy Stock Item")
|
||||
self.ajax_form_title = _("Duplicate Stock Item")
|
||||
except StockItem.DoesNotExist:
|
||||
initials = super(StockItemCreate, self).get_initial().copy()
|
||||
|
||||
|
Reference in New Issue
Block a user