From 757cd539b2701a7aba5e4d421e5c37752ec4f6eb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 25 Apr 2019 23:01:03 +1000 Subject: [PATCH] Enforce 'notes' field for StockItem move - Better error handling for StockItem.move --- InvenTree/static/script/inventree/stock.js | 26 +++++++++++++++++----- InvenTree/stock/api.py | 5 ++++- InvenTree/stock/models.py | 16 ++++++++----- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index a858dca122..a32e446ad6 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -225,11 +225,12 @@ function moveStockItems(items, options) { return; } - function doMove(location, parts) { + function doMove(location, parts, notes) { inventreeUpdate("/api/stock/move/", { location: location, - 'parts[]': parts + 'parts[]': parts, + 'notes': notes, }, { success: function(response) { @@ -267,9 +268,13 @@ function moveStockItems(items, options) { html += makeOption(loc.pk, loc.name + ' - ' + loc.description + ''); } - html += "

"; + html += "
"; - html += "The following stock items will be moved: