From d8eefec0653959d1a416517031684ea74c6908a8 Mon Sep 17 00:00:00 2001 From: Guusggg Date: Tue, 17 Aug 2021 04:42:40 +0200 Subject: [PATCH] Print multi part label (#1963) * Added description as list for StockLocation * Merge pull request #1874 from SchrodingersGat/docker-dev-fix Copy static files when starting dev server (cherry picked from commit 50eb70f538a0788a4e565db0b4a5775a2ee5bf78) * Merge pull request #1877 from eeintech/fix_search_js Fixed missing comma propagating to translated JS files (cherry picked from commit 2009773d9dca7ee309e70e14bd9aa656b54843c9) * Merge pull request #1890 from matmair/fix-for-1888 catch connection errors in exchange update (cherry picked from commit db57e9516bbb53f008a970331b83939c7e007d57) * Merge pull request #1887 from matmair/settings-safety settings fixes (cherry picked from commit d154ca08ea31f990b8de765cce211b362914afb2) * 0.4.2 * Merge pull request #1894 from SchrodingersGat/non-int-serial-fix Fix for non-integer serial numbers (cherry picked from commit 529742b5203005d5d71921c1ee32cd1bc540af4d) * 0.4.4 Bump release version * Bump version number -> 0.4.5 * Added a simple menu item to print multiple part labels. This does not follow the style of the Stock label functions but it works! * Revert "Added description as list for StockLocation" This reverts commit f5178e9fc36b9c93dc764ceab0c8668ec97cc34a. * Added the right version number Co-authored-by: Oliver --- InvenTree/part/templates/part/category.html | 3 ++- InvenTree/templates/js/translated/part.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/templates/part/category.html b/InvenTree/part/templates/part/category.html index af07952a7e..44e3ee0daa 100644 --- a/InvenTree/part/templates/part/category.html +++ b/InvenTree/part/templates/part/category.html @@ -138,6 +138,7 @@
  • {% trans "Set Category" %}
  • {% endif %}
  • {% trans "Order Parts" %}
  • +
  • {% trans "Print Labels" %}
  • {% trans "Export Data" %}
  • @@ -337,4 +338,4 @@ default: 'part-stock' }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 93fb7066a4..4ed631fe61 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -1003,6 +1003,18 @@ function loadPartTable(table, url, options={}) { }); }); + $('#multi-part-print-label').click(function() { + var selections = $(table).bootstrapTable('getSelections'); + + var items = []; + + selections.forEach(function(item) { + items.push(item.pk); + }); + + printPartLabels(items); + }); + $('#multi-part-export').click(function() { var selections = $(table).bootstrapTable("getSelections");