2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Location barcode actions (#3887)

* Reorder action buttons for stock location

* Tweak position of "New Location" button

* Tweak loaction of "New Category" button for part category page

* Working on skeleton for new barcode dialog

* Scan location into location

* Add configurable input delay for processing barcode scan data
This commit is contained in:
Oliver
2022-11-01 22:18:10 +11:00
committed by GitHub
parent 9beefd09f7
commit db45b6f9dc
5 changed files with 161 additions and 34 deletions

View File

@ -53,12 +53,21 @@
{% else %}
<li><a class='dropdown-item' href='#' id='barcode-link'><span class='fas fa-link'></span> {% trans "Link Barcode" %}</a></li>
{% endif %}
{% if labels_enabled %}
<li><a class='dropdown-item' href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
<li><a class='dropdown-item' href='#' id='barcode-scan-in-items' title='{% trans "Scan stock items into this location" %}'><span class='fas fa-boxes'></span> {% trans "Scan In Stock Items" %}</a></li>
<li><a class='dropdown-item' href='#' id='barcode-scan-in-containers' title='{% trans "Scan stock container into this location" %}'><span class='fas fa-sitemap'></span> {% trans "Scan In Container" %}</a></li>
</ul>
</div>
<!-- Printing action -->
{% if labels_enabled %}
<div class='btn-group' role='group'>
<button id='printing-options' title='{% trans "Printing actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-print'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu'>
<li><a class='dropdown-item' href='#' id='print-label'><span class='fas fa-print'></span> {% trans "Print Label" %}</a>
</ul>
</div>
{% endif %}
<!-- Check permissions and owner -->
{% if user_owns_location %}
{% if roles.stock.change %}
@ -96,11 +105,6 @@
{% endif %}
{% endif %}
{% endif %}
{% if user_owns_location and roles.stock_location.add %}
<button class='btn btn-success' id='location-create' type='button' title='{% trans "Create new stock location" %}'>
<span class='fas fa-plus-circle'></span> {% trans "New Location" %}
</button>
{% endif %}
{% endblock %}
{% block details_left %}
@ -203,7 +207,17 @@
<div class='panel panel-hidden' id='panel-sublocations'>
<div class='panel-heading'>
<h4>{% trans "Sublocations" %}</h4>
<div class='d-flex flex-wrap'>
<h4>{% trans "Sublocations" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
{% if user_owns_location and roles.stock_location.add %}
<button class='btn btn-success' id='location-create' type='button' title='{% trans "Create new stock location" %}'>
<span class='fas fa-plus-circle'></span> {% trans "New Location" %}
</button>
{% endif %}
</div>
</div>
</div>
<div class='panel-content'>
<div id='sublocation-button-toolbar'>
@ -284,13 +298,29 @@
{% endif %}
{% if location %}
$("#barcode-check-in").click(function() {
barcodeCheckIn({{ location.id }});
$("#barcode-scan-in-items").click(function() {
barcodeCheckInStockItems({{ location.id }});
});
$('#barcode-scan-in-containers').click(function() {
barcodeCheckInStockLocations({{ location.id }},
{
onSuccess: function() {
showMessage(
'{% trans "Scanned stock container into this location" %}',
{
style: 'success',
}
);
$('#sublocation-table').bootstrapTable('refresh');
}
}
);
});
{% endif %}
$('#location-create').click(function () {
createStockLocation({
{% if location %}
parent: {{ location.pk }},