mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Tweaks for barcode scanning functionality
- Prevent javascript errors (cherry picked from commit 9129a42a3e2a5c5939e6002d3b4010b3fd9cc20e)
This commit is contained in:
		@@ -366,7 +366,6 @@ function barcodeCheckIn(location_id) {
 | 
			
		||||
    // List of items we are going to checkin
 | 
			
		||||
    var items = [];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function reloadTable() {
 | 
			
		||||
 | 
			
		||||
        modalEnable(modal, false);
 | 
			
		||||
@@ -389,10 +388,17 @@ function barcodeCheckIn(location_id) {
 | 
			
		||||
            <tbody>`;
 | 
			
		||||
 | 
			
		||||
        items.forEach(function(item) {
 | 
			
		||||
 | 
			
		||||
            var location_info = `${item.location}`;
 | 
			
		||||
 | 
			
		||||
            if (item.location_detail) {
 | 
			
		||||
                location_info = `${item.location_detail.name}`;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            html += `
 | 
			
		||||
            <tr pk='${item.pk}'>
 | 
			
		||||
                <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>${makeIconButton('fa-times-circle icon-red', 'button-item-remove', item.pk, '{% trans "Remove stock item" %}')}</td>
 | 
			
		||||
            </tr>`;
 | 
			
		||||
@@ -469,6 +475,12 @@ function barcodeCheckIn(location_id) {
 | 
			
		||||
 | 
			
		||||
                data.items = entries;
 | 
			
		||||
 | 
			
		||||
                // Prevent submission without any entries
 | 
			
		||||
                if (entries.length == 0) {
 | 
			
		||||
                    showBarcodeMessage(modal, '{% trans "No barcode provided" %}', 'warning');
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                inventreePut(
 | 
			
		||||
                    '{% url "api-stock-transfer" %}',
 | 
			
		||||
                    data,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user