diff --git a/InvenTree/static/script/inventree/api.js b/InvenTree/static/script/inventree/api.js index a2f0e14814..c9b593f3b1 100644 --- a/InvenTree/static/script/inventree/api.js +++ b/InvenTree/static/script/inventree/api.js @@ -23,6 +23,7 @@ function inventreeGet(url, filters={}, options={}) { type: 'GET', data: filters, dataType: 'json', + contentType: 'application/json', success: function(response) { console.log('Success GET data at ' + url); if (options.success) { @@ -62,8 +63,9 @@ function inventreeUpdate(url, data={}, options={}) { }, url: url, type: method, - data: data, + data: JSON.stringify(data), dataType: 'json', + contentType: 'application/json', success: function(response, status) { response['_status_code'] = status; console.log('UPDATE object to ' + url + ' - result = ' + status); diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index 55e9f2d423..7a1bb3f8d6 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -16,7 +16,7 @@ function moveStockItems(items, options) { inventreeUpdate("/api/stock/move/", { location: location, - parts: parts + 'parts[]': parts }, { success: function(response) { @@ -97,8 +97,67 @@ function countStockItems(items, options) { return; } + var tbl = "