diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index d58086fd84..db9c4417d5 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -75,24 +75,19 @@
{% endif %} @@ -618,7 +612,25 @@ $("#stock-convert").click(function() { }); {% endif %} -{% if item.in_stock %} +{% if item.customer %} +$("#stock-return-from-customer").click(function() { + + constructForm('{% url "api-stock-item-return" item.pk %}', { + fields: { + location: { + {% if item.part.default_location %} + value: {{ item.part.default_location.pk }}, + {% endif %} + }, + notes: {}, + }, + method: 'POST', + title: '{% trans "Return to Stock" %}', + reload: true, + }); + +}); +{% else %} $("#stock-assign-to-customer").click(function() { inventreeGet('{% url "api-stock-detail" item.pk %}', {}, { @@ -634,6 +646,9 @@ $("#stock-assign-to-customer").click(function() { } }); }); +{% endif %} + +{% if item.can_adjust_location %} $("#stock-move").click(function() { itemAdjust("move"); @@ -647,26 +662,6 @@ $('#stock-remove').click(function() { itemAdjust('take'); }); -{% else %} - -$("#stock-return-from-customer").click(function() { - - constructForm('{% url "api-stock-item-return" item.pk %}', { - fields: { - location: { - {% if item.part.default_location %} - value: {{ item.part.default_location.pk }}, - {% endif %} - }, - notes: {}, - }, - method: 'POST', - title: '{% trans "Return to Stock" %}', - reload: true, - }); - -}); - {% endif %} $('#serial-number-search').click(function() {