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,37 +612,7 @@ $("#stock-convert").click(function() { }); {% endif %} -{% if item.in_stock %} -$("#stock-assign-to-customer").click(function() { - - inventreeGet('{% url "api-stock-detail" item.pk %}', {}, { - success: function(response) { - assignStockToCustomer( - [response], - { - success: function() { - location.reload(); - }, - } - ); - } - }); -}); - -$("#stock-move").click(function() { - itemAdjust("move"); -}); - -$("#stock-count").click(function() { - itemAdjust('count'); -}); - -$('#stock-remove').click(function() { - itemAdjust('take'); -}); - -{% else %} - +{% if item.customer %} $("#stock-return-from-customer").click(function() { constructForm('{% url "api-stock-item-return" item.pk %}', { @@ -666,6 +630,37 @@ $("#stock-return-from-customer").click(function() { }); }); +{% else %} +$("#stock-assign-to-customer").click(function() { + + inventreeGet('{% url "api-stock-detail" item.pk %}', {}, { + success: function(response) { + assignStockToCustomer( + [response], + { + success: function() { + location.reload(); + }, + } + ); + } + }); +}); +{% endif %} + +{% if item.can_adjust_location %} + +$("#stock-move").click(function() { + itemAdjust("move"); +}); + +$("#stock-count").click(function() { + itemAdjust('count'); +}); + +$('#stock-remove').click(function() { + itemAdjust('take'); +}); {% endif %}