2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Add endpoint for printing labels

This commit is contained in:
Oliver Walters
2021-01-09 20:43:48 +11:00
parent 44e60a705e
commit bdc7367e29
7 changed files with 184 additions and 41 deletions

View File

@ -645,6 +645,39 @@ function loadStockTable(table, options) {
}
// Automatically link button callbacks
$('#multi-item-print-label').click(function() {
var selections = $('#stock-table').bootstrapTable('getSelections');
var items = [];
selections.forEach(function(item) {
items.push(item.pk);
});
// Request available labels from the server
inventreeGet(
'{% url "api-stockitem-label-list" %}',
{
enabled: true,
items: items,
},
{
success: function(response) {
if (response.length == 0) {
showAlertDialog(
'{% trans "No Labels Found" %}',
'{% trans "No labels found which match selected stock item(s)" %}',
);
return;
}
var label = selectLabel(response);
}
}
);
});
$('#multi-item-stocktake').click(function() {
stockAdjustment('count');
});