From 4104e7df8e8c17ac813e94aca29fa26745cdecab Mon Sep 17 00:00:00 2001 From: eeintech Date: Tue, 1 Dec 2020 16:08:27 -0500 Subject: [PATCH] Fixed template logic --- InvenTree/stock/templates/stock/item.html | 4 +- .../stock/templates/stock/item_base.html | 99 +++++++++---------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index f9cbf472bc..51eae668f4 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -13,7 +13,8 @@ {% setting_object 'STOCK_OWNER' as owner_enable %} -{% if user.is_superuser or roles.stock.change and item.owner == user and owner_enable.value == "True" %} +{% if owner_enable.value == "False" or owner_enable.value == "True" and item.owner == user %} +{% if roles.stock.change and not item.is_building %}
{% endif %} +{% endif %}
diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 876f8605d9..c05a1c30df 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -114,57 +114,56 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% setting_object 'STOCK_OWNER' as owner_enable %} - {% if user.is_superuser or roles.stock.change and item.owner == user and owner_enable.value == "True" %} - {% if not item.is_building %} -
- - -
- {% endif %} - - {% if roles.stock.change and not item.is_building %} -
- - +
+ {% endif %} + + {% if roles.stock.change and not item.is_building %} +
+ + +
+ {% endif %} {% endif %}