From 8b6abe1505e6e835dd5eb4fb85058e27d8d82de5 Mon Sep 17 00:00:00 2001
From: Oliver <oliver.henry.walters@gmail.com>
Date: Mon, 26 Jun 2023 12:14:44 +1000
Subject: [PATCH] Fix for stock status change (#5105)

- Recent refactor introduced bug
- Update stock.js
---
 InvenTree/templates/js/translated/stock.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js
index 1299ad81dd..09351e0bc1 100644
--- a/InvenTree/templates/js/translated/stock.js
+++ b/InvenTree/templates/js/translated/stock.js
@@ -3169,7 +3169,11 @@ function setStockStatus(items, options={}) {
             note: {},
         },
         processBeforeUpload: function(data) {
-            data.items = items;
+            let item_pk_values = [];
+            items.forEach(function(item) {
+                item_pk_values.push(item.pk);
+            });
+            data.items = item_pk_values;
             return data;
         },
         onSuccess: function() {