diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js
index 6b1db9fc4c..f55deeacef 100644
--- a/InvenTree/templates/js/translated/order.js
+++ b/InvenTree/templates/js/translated/order.js
@@ -540,10 +540,13 @@ function orderParts(parts_list, options={}) {
var buttons = `
`;
buttons += makeIconButton(
- 'fa-check-circle icon-green',
- 'button-row-complete',
+ 'fa-layer-group',
+ 'button-row-expand',
pk,
- '{% trans "Add to order" %}',
+ '{% trans "Expand Row" %}',
+ {
+ collapseTarget: `order_row_expand_${pk}`,
+ }
);
if (parts.length > 1) {
@@ -564,8 +567,18 @@ function orderParts(parts_list, options={}) {
${purchase_order_input} |
${quantity_input} |
${buttons} |
-
- `;
+ `;
+
+ // Add a second row "underneath" the first one, but collapsed
+ // Allows extra data to be added if required, but hidden by default
+ html += `
+
+ |
+ reference goes here |
+ |
+ |
+ |
+
`;
return html;
}
@@ -656,6 +669,12 @@ function orderParts(parts_list, options={}) {
}
}, null, opts);
+ // Add callback for "remove row" button
+ $(opts.modal).find('.button-row-remove').click(function() {
+ var pk = $(this).attr('pk');
+
+ $(opts.modal).find(`#order_row_${pk}`).remove();
+ });
});
}
});
diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js
index 6fd144d5f0..3aa3b936cf 100644
--- a/InvenTree/templates/js/translated/part.js
+++ b/InvenTree/templates/js/translated/part.js
@@ -1559,15 +1559,16 @@ function loadPartTable(table, url, options={}) {
var parts = [];
- selections.forEach(function(item) {
- parts.push(item.pk);
+ selections.forEach(function(part) {
+ parts.push(part);
});
- launchModalForm('/order/purchase-order/order-parts/', {
- data: {
- parts: parts,
- },
- });
+ orderParts(
+ parts,
+ {
+
+ }
+ );
});
$('#multi-part-category').click(function() {