From 022d40edbe37be49644db44ba9bbbf32ce4930ae Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 22 Apr 2022 12:36:14 +0200 Subject: [PATCH] add print_labels instead of call submit from the template --- ereuse_devicehub/static/js/main_inventory.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index bf2fdf43..03073192 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -1,4 +1,5 @@ $(document).ready(function() { + $(".deviceSelect").on("change", deviceSelect); var show_allocate_form = $("#allocateModal").data('show-action-form'); var show_datawipe_form = $("#datawipeModal").data('show-action-form'); var show_trade_form = $("#tradeLotModal").data('show-action-form'); @@ -11,8 +12,6 @@ $(document).ready(function() { } else if (show_trade_form != "None") { $("#tradeLotModal .btn-primary").show(); newTrade(show_trade_form); - } else { - $(".deviceSelect").on("change", deviceSelect); } // $('#selectLot').selectpicker(); }) @@ -181,6 +180,11 @@ function export_file(type_file) { } } +function print_labels() { + deviceSelect(); + $('#print_labels').submit(); +} + /** * Reactive lots button