diff --git a/src/backend/InvenTree/templates/js/translated/sales_order.js b/src/backend/InvenTree/templates/js/translated/sales_order.js
index 01611aec6c..395789d400 100644
--- a/src/backend/InvenTree/templates/js/translated/sales_order.js
+++ b/src/backend/InvenTree/templates/js/translated/sales_order.js
@@ -281,55 +281,13 @@ function completeSalesOrderShipment(shipment_id, options={}) {
// Request the list of stock items which will be shipped
inventreeGet(`{% url "api-so-shipment-list" %}${shipment_id}/`, {}, {
success: function(shipment) {
- var allocations = shipment.allocations;
+ let allocations = shipment.allocated_items ?? 0;
- var html = '';
-
- if (!allocations || allocations.length == 0) {
- html = `
-
- {% trans "No stock items have been allocated to this shipment" %}
-
- `;
- } else {
- html = `
- {% trans "The following stock items will be shipped" %}
-
-
-
- {% trans "Part" %} |
- {% trans "Stock Item" %} |
-
-
-
- `;
-
- allocations.forEach(function(allocation) {
-
- var part = allocation.part_detail;
- var thumb = thumbnailImage(part.thumbnail || part.image);
-
- var stock = '';
-
- if (allocation.serial) {
- stock = `{% trans "Serial Number" %}: ${allocation.serial}`;
- } else {
- stock = `{% trans "Quantity" %}: ${allocation.quantity}`;
- }
-
- html += `
-
- ${thumb} ${part.full_name} |
- ${stock} |
-
- `;
- });
-
- html += `
-
-
- `;
- }
+ var html = allocations == 0 ? (
+ `
+ {% trans "No stock items have been allocated to this shipment" %}
+
`
+ ) : '';
constructForm(`{% url "api-so-shipment-list" %}${shipment_id}/ship/`, {
method: 'POST',
@@ -398,7 +356,8 @@ function completePendingShipments(order_id, options={}) {
var allocated_shipments = [];
for (var idx = 0; idx < pending_shipments.length; idx++) {
- if (pending_shipments[idx].allocations.length > 0) {
+
+ if (pending_shipments[idx].allocated_items > 0) {
allocated_shipments.push(pending_shipments[idx]);
}
}
@@ -1638,6 +1597,7 @@ function showAllocationSubTable(index, row, element, options) {
...options.queryParams,
part_detail: true,
location_detail: true,
+ item_detail: true,
order_detail: true,
},
data: row.allocations,