From ff7a75266b45b764feaa20fc089880a44485a7d4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 8 Jan 2022 20:28:57 +1100 Subject: [PATCH] Fixes for stock location forms --- InvenTree/stock/serializers.py | 1 + InvenTree/templates/js/translated/stock.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py index 1c4c8844ff..cdc844095b 100644 --- a/InvenTree/stock/serializers.py +++ b/InvenTree/stock/serializers.py @@ -426,6 +426,7 @@ class LocationSerializer(InvenTree.serializers.InvenTreeModelSerializer): 'parent', 'pathstring', 'items', + 'owner', ] diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index 988b93cad9..ded4c48883 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -111,12 +111,17 @@ function stockLocationFields(options={}) { }, name: {}, description: {}, + owner: {}, }; if (options.parent) { fields.parent.value = options.parent; } + if (!global_settings.STOCK_OWNERSHIP_CONTROL) { + delete fields['owner']; + } + return fields; } @@ -130,6 +135,8 @@ function editStockLocation(pk, options={}) { options.fields = stockLocationFields(options); + options.title = '{% trans "Edit Stock Location" %}'; + constructForm(url, options); }