diff --git a/InvenTree/company/templates/company/manufacturer_part_suppliers.html b/InvenTree/company/templates/company/manufacturer_part_suppliers.html
index f3b87f4658..f706ca90ba 100644
--- a/InvenTree/company/templates/company/manufacturer_part_suppliers.html
+++ b/InvenTree/company/templates/company/manufacturer_part_suppliers.html
@@ -42,8 +42,11 @@
-
-
+
+
+
@@ -115,6 +118,46 @@ $("#supplier-part-delete").click(function() {
});
});
+$("#multi-parameter-delete").click(function() {
+
+ var selections = $("#parameter-table").bootstrapTable("getSelections");
+
+ var text = `
+
+
{% trans "Selected parameters will be deleted" %}:
+
`;
+
+ selections.forEach(function(item) {
+ text += `- ${item.name} - ${item.value}
`;
+ });
+
+ text += `
+
+
`;
+
+ showQuestionDialog(
+ '{% trans "Delete Parameters" %}',
+ text,
+ {
+ accept_text: '{% trans "Delete" %}',
+ accept: function() {
+ // Delete each parameter via the API
+ var requests = [];
+
+ selections.forEach(function(item) {
+ var url = `/api/company/part/manufacturer/parameter/${item.pk}/`;
+
+ requests.push(inventreeDelete(url));
+ });
+
+ $.when.apply($, requests).then(function() {
+ $('#parameter-table').bootstrapTable('refresh');
+ });
+ }
+ }
+ );
+});
+
loadSupplierPartTable(
"#supplier-table",
"{% url 'api-supplier-part-list' %}",
@@ -140,5 +183,5 @@ loadManufacturerPartParameterTable(
);
linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options'])
-
+linkButtonsToSelection($("#parameter-table"), ['#parameter-options'])
{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html
index 07da7af926..ba3e9be2b9 100644
--- a/InvenTree/part/templates/part/bom.html
+++ b/InvenTree/part/templates/part/bom.html
@@ -123,7 +123,7 @@
});
// Wait for *all* the requests to complete
- $.when(requests).then(function() {
+ $.when.apply($, requests).then(function() {
location.reload();
});
}
diff --git a/InvenTree/templates/js/company.js b/InvenTree/templates/js/company.js
index 7c70af866b..d28bca5547 100644
--- a/InvenTree/templates/js/company.js
+++ b/InvenTree/templates/js/company.js
@@ -213,7 +213,7 @@ function deleteManufacturerParts(selections, options={}) {
});
// Wait for all the requests to complete
- $.when(requests).then(function() {
+ $.when.apply($, requests).then(function() {
if (options.onSuccess) {
options.onSuccess();
@@ -352,7 +352,7 @@ function loadManufacturerPartParameterTable(table, url, options) {
{
checkbox: true,
switchable: false,
- visible: false,
+ visible: true,
},
{
field: 'name',
diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js
index 97b9df0c68..b557f0c327 100644
--- a/InvenTree/templates/js/stock.js
+++ b/InvenTree/templates/js/stock.js
@@ -906,7 +906,7 @@ function loadStockTable(table, options) {
);
});
- $.when(requests).then(function() {
+ $.when.apply($, requests).then(function() {
$("#stock-table").bootstrapTable('refresh');
});
})