From 3715c5d63790724f337214a78b708073946be5a7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 17 Feb 2020 22:44:41 +1100 Subject: [PATCH] Set the parent relationship when serializing StockItem object - Keep track of which StockItem is came from --- InvenTree/stock/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 1e11525703..6c74329709 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -487,6 +487,7 @@ class StockItem(MPTTModel): new_item.quantity = 1 new_item.serial = serial new_item.pk = None + new_item.parent = self if location: new_item.location = location