From 64f5007d3a2a4d0606dba2614d9d5119f3d49873 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 8 Nov 2021 14:47:14 +1100 Subject: [PATCH 1/2] Fix missing actions for stock item (cherry picked from commit c128438ebf8f97cc3dc6a8087c17375dfbd2fa4f) --- InvenTree/stock/templates/stock/item_base.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index f64c9b0704..0f8d81203a 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -53,6 +53,12 @@ + +{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} +{% if owner_control.value == "True" %} + {% authorized_owners item.owner as owners %} +{% endif %} + {% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %} {% if roles.stock.change and not item.is_building %}
From cb075ed2c2b97e031a50c1529a769756fce6ff42 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 8 Nov 2021 15:10:41 +1100 Subject: [PATCH 2/2] Fix logic for converting stock items to applicable variants --- InvenTree/part/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 23aea29dbd..3ab616d96d 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -2050,10 +2050,10 @@ class Part(MPTTModel): if self.variant_of: parts.append(self.variant_of) - siblings = self.get_siblings(include_self=False) + siblings = self.get_siblings(include_self=False) - for sib in siblings: - parts.append(sib) + for sib in siblings: + parts.append(sib) filtered_parts = Part.objects.filter(pk__in=[part.pk for part in parts])