mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue2385
This commit is contained in:
commit
3ffe51b4c3
@ -11,10 +11,14 @@
|
|||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
{% trans "Upload File for Purchase Order" as header_text %}
|
{% trans "Upload File for Purchase Order" as header_text %}
|
||||||
{% order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change as upload_go_ahead %}
|
|
||||||
{% trans "Order is already processed. Files cannot be uploaded." as error_text %}
|
{% trans "Order is already processed. Files cannot be uploaded." as error_text %}
|
||||||
{% "panel-upload-file" as panel_id %}
|
{% with "panel-upload-file" as panel_id %}
|
||||||
{% include "patterns/wizard/upload.html" with header_text=header_text upload_go_ahead=upload_go_ahead error_text=error_text panel_id=panel_id %}
|
{% if order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change %}
|
||||||
|
{% include "patterns/wizard/upload.html" with header_text=header_text upload_go_ahead=True error_text=error_text panel_id=panel_id %}
|
||||||
|
{% else %}
|
||||||
|
{% include "patterns/wizard/upload.html" with header_text=header_text upload_go_ahead=False error_text=error_text panel_id=panel_id %}
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% trans "Import Parts from File" as header_text %}
|
{% trans "Import Parts from File" as header_text %}
|
||||||
{% roles.part.change as upload_go_ahead %}
|
|
||||||
{% trans "Unsuffitient privileges." as error_text %}
|
{% trans "Unsuffitient privileges." as error_text %}
|
||||||
{% include "patterns/wizard/upload.html" with header_text=header_text upload_go_ahead=upload_go_ahead error_text=error_text %}
|
{% include "patterns/wizard/upload.html" with header_text=header_text upload_go_ahead=roles.part.change error_text=error_text %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
|
@ -505,7 +505,12 @@ $("#barcode-unlink").click(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#barcode-scan-into-location").click(function() {
|
$("#barcode-scan-into-location").click(function() {
|
||||||
scanItemsIntoLocation([{{ item.id }}]);
|
|
||||||
|
inventreeGet('{% url "api-stock-detail" item.pk %}', {}, {
|
||||||
|
success: function(item) {
|
||||||
|
scanItemsIntoLocation([item]);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function itemAdjust(action) {
|
function itemAdjust(action) {
|
||||||
|
@ -179,6 +179,11 @@ function showApiError(xhr, url) {
|
|||||||
var title = null;
|
var title = null;
|
||||||
var message = null;
|
var message = null;
|
||||||
|
|
||||||
|
if (xhr.statusText == 'abort') {
|
||||||
|
// Don't show errors for requests which were intentionally aborted
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (xhr.status || 0) {
|
switch (xhr.status || 0) {
|
||||||
// No response
|
// No response
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -359,14 +359,13 @@ function unlinkBarcode(stockitem) {
|
|||||||
/*
|
/*
|
||||||
* Display dialog to check multiple stock items in to a stock location.
|
* Display dialog to check multiple stock items in to a stock location.
|
||||||
*/
|
*/
|
||||||
function barcodeCheckIn(location_id) {
|
function barcodeCheckIn(location_id, options={}) {
|
||||||
|
|
||||||
var modal = '#modal-form';
|
var modal = '#modal-form';
|
||||||
|
|
||||||
// List of items we are going to checkin
|
// List of items we are going to checkin
|
||||||
var items = [];
|
var items = [];
|
||||||
|
|
||||||
|
|
||||||
function reloadTable() {
|
function reloadTable() {
|
||||||
|
|
||||||
modalEnable(modal, false);
|
modalEnable(modal, false);
|
||||||
@ -389,10 +388,17 @@ function barcodeCheckIn(location_id) {
|
|||||||
<tbody>`;
|
<tbody>`;
|
||||||
|
|
||||||
items.forEach(function(item) {
|
items.forEach(function(item) {
|
||||||
|
|
||||||
|
var location_info = `${item.location}`;
|
||||||
|
|
||||||
|
if (item.location_detail) {
|
||||||
|
location_info = `${item.location_detail.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<tr pk='${item.pk}'>
|
<tr pk='${item.pk}'>
|
||||||
<td>${imageHoverIcon(item.part_detail.thumbnail)} ${item.part_detail.name}</td>
|
<td>${imageHoverIcon(item.part_detail.thumbnail)} ${item.part_detail.name}</td>
|
||||||
<td>${item.location_detail.name}</td>
|
<td>${location_info}</td>
|
||||||
<td>${item.quantity}</td>
|
<td>${item.quantity}</td>
|
||||||
<td>${makeIconButton('fa-times-circle icon-red', 'button-item-remove', item.pk, '{% trans "Remove stock item" %}')}</td>
|
<td>${makeIconButton('fa-times-circle icon-red', 'button-item-remove', item.pk, '{% trans "Remove stock item" %}')}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
@ -469,6 +475,12 @@ function barcodeCheckIn(location_id) {
|
|||||||
|
|
||||||
data.items = entries;
|
data.items = entries;
|
||||||
|
|
||||||
|
// Prevent submission without any entries
|
||||||
|
if (entries.length == 0) {
|
||||||
|
showBarcodeMessage(modal, '{% trans "No barcode provided" %}', 'warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
inventreePut(
|
inventreePut(
|
||||||
'{% url "api-stock-transfer" %}',
|
'{% url "api-stock-transfer" %}',
|
||||||
data,
|
data,
|
||||||
@ -477,15 +489,11 @@ function barcodeCheckIn(location_id) {
|
|||||||
success: function(response, status) {
|
success: function(response, status) {
|
||||||
// Hide the modal
|
// Hide the modal
|
||||||
$(modal).modal('hide');
|
$(modal).modal('hide');
|
||||||
if (status == 'success' && 'success' in response) {
|
|
||||||
|
|
||||||
addCachedAlert(response.success);
|
if (options.success) {
|
||||||
location.reload();
|
options.success(response);
|
||||||
} else {
|
} else {
|
||||||
showMessage('{% trans "Error transferring stock" %}', {
|
location.reload();
|
||||||
style: 'danger',
|
|
||||||
icon: 'fas fa-times-circle',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -533,7 +541,7 @@ function barcodeCheckIn(location_id) {
|
|||||||
/*
|
/*
|
||||||
* Display dialog to check a single stock item into a stock location
|
* Display dialog to check a single stock item into a stock location
|
||||||
*/
|
*/
|
||||||
function scanItemsIntoLocation(item_id_list, options={}) {
|
function scanItemsIntoLocation(item_list, options={}) {
|
||||||
|
|
||||||
var modal = options.modal || '#modal-form';
|
var modal = options.modal || '#modal-form';
|
||||||
|
|
||||||
@ -583,9 +591,10 @@ function scanItemsIntoLocation(item_id_list, options={}) {
|
|||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
|
|
||||||
item_id_list.forEach(function(pk) {
|
item_list.forEach(function(item) {
|
||||||
items.push({
|
items.push({
|
||||||
pk: pk,
|
pk: item.pk || item.id,
|
||||||
|
quantity: item.quantity,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -605,13 +614,10 @@ function scanItemsIntoLocation(item_id_list, options={}) {
|
|||||||
// First hide the modal
|
// First hide the modal
|
||||||
$(modal).modal('hide');
|
$(modal).modal('hide');
|
||||||
|
|
||||||
if (status == 'success' && 'success' in response) {
|
if (options.success) {
|
||||||
addCachedAlert(response.success);
|
options.success(response);
|
||||||
location.reload();
|
|
||||||
} else {
|
} else {
|
||||||
showMessage('{% trans "Error transferring stock" %}', {
|
location.reload();
|
||||||
style: 'danger',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,8 @@ function updateSearch() {
|
|||||||
var params = {};
|
var params = {};
|
||||||
|
|
||||||
if (user_settings.SEARCH_HIDE_INACTIVE_PARTS) {
|
if (user_settings.SEARCH_HIDE_INACTIVE_PARTS) {
|
||||||
params.active = false;
|
// Return *only* active parts
|
||||||
|
params.active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for matching parts
|
// Search for matching parts
|
||||||
|
@ -1972,7 +1972,7 @@ function loadStockTable(table, options) {
|
|||||||
var items = [];
|
var items = [];
|
||||||
|
|
||||||
selections.forEach(function(item) {
|
selections.forEach(function(item) {
|
||||||
items.push(item.pk);
|
items.push(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
scanItemsIntoLocation(items);
|
scanItemsIntoLocation(items);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
|
||||||
<div class='panel' id='{{ panel_id }}'>
|
<div class='panel' id='{{ panel_id }}'>
|
||||||
<div class='panel-heading'>
|
<div class='panel-heading'>
|
||||||
<h4>
|
<h4>
|
||||||
|
Loading…
Reference in New Issue
Block a user