diff --git a/InvenTree/order/templates/order/order_wizard/po_upload.html b/InvenTree/order/templates/order/order_wizard/po_upload.html index b101cfc8b5..d33d27f6c6 100644 --- a/InvenTree/order/templates/order/order_wizard/po_upload.html +++ b/InvenTree/order/templates/order/order_wizard/po_upload.html @@ -11,10 +11,14 @@ {% block page_content %} {% 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 %} - {% "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 %} + {% with "panel-upload-file" as 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 %} {% block js_ready %} diff --git a/InvenTree/part/templates/part/import_wizard/part_upload.html b/InvenTree/part/templates/part/import_wizard/part_upload.html index 4fef625d1d..025a4e997c 100644 --- a/InvenTree/part/templates/part/import_wizard/part_upload.html +++ b/InvenTree/part/templates/part/import_wizard/part_upload.html @@ -11,9 +11,8 @@ {% block content %} {% trans "Import Parts from File" as header_text %} - {% roles.part.change as upload_go_ahead %} {% 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 %} {% block js_ready %} diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 8f62f2c852..dd77d26d1c 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -505,7 +505,12 @@ $("#barcode-unlink").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) { diff --git a/InvenTree/templates/js/translated/api.js b/InvenTree/templates/js/translated/api.js index eadf2e2afc..fccd6bf5ef 100644 --- a/InvenTree/templates/js/translated/api.js +++ b/InvenTree/templates/js/translated/api.js @@ -179,6 +179,11 @@ function showApiError(xhr, url) { var title = null; var message = null; + if (xhr.statusText == 'abort') { + // Don't show errors for requests which were intentionally aborted + return; + } + switch (xhr.status || 0) { // No response case 0: diff --git a/InvenTree/templates/js/translated/barcode.js b/InvenTree/templates/js/translated/barcode.js index 6be56d14f1..b08d9170bc 100644 --- a/InvenTree/templates/js/translated/barcode.js +++ b/InvenTree/templates/js/translated/barcode.js @@ -359,14 +359,13 @@ function unlinkBarcode(stockitem) { /* * 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'; // List of items we are going to checkin var items = []; - function reloadTable() { modalEnable(modal, false); @@ -389,10 +388,17 @@ function barcodeCheckIn(location_id) {
`; items.forEach(function(item) { + + var location_info = `${item.location}`; + + if (item.location_detail) { + location_info = `${item.location_detail.name}`; + } + html += `