From 782a0f3576577516008e7a21afcc3243ac8a1344 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 4 Apr 2022 16:23:17 +1000 Subject: [PATCH] Fix for scanIntoLocation function --- InvenTree/templates/js/translated/barcode.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/InvenTree/templates/js/translated/barcode.js b/InvenTree/templates/js/translated/barcode.js index f59f2a3054..b08d9170bc 100644 --- a/InvenTree/templates/js/translated/barcode.js +++ b/InvenTree/templates/js/translated/barcode.js @@ -359,7 +359,7 @@ 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'; @@ -489,15 +489,11 @@ function barcodeCheckIn(location_id) { success: function(response, status) { // Hide the modal $(modal).modal('hide'); - if (status == 'success' && 'success' in response) { - addCachedAlert(response.success); - location.reload(); + if (options.success) { + options.success(response); } else { - showMessage('{% trans "Error transferring stock" %}', { - style: 'danger', - icon: 'fas fa-times-circle', - }); + location.reload(); } } }