Add some more functionality to StockLocation page

This commit is contained in:
Oliver 2021-07-12 20:53:36 +10:00
parent 2ea4824030
commit e9bf4b4cef
2 changed files with 17 additions and 3 deletions

View File

@ -63,7 +63,7 @@
<li>
<a href='#' id='part-move'>
<span class='fas fa-exchange-alt'></span>
{% trans "Move part stock" %}
{% trans "Transfer part stock" %}
</a>
</li>
</ul>

View File

@ -69,6 +69,12 @@
{% trans "Count stock" %}
</a>
</li>
<li>
<a href='#' id='location-move'>
<span class='fas fa-exchange-alt'></span>
{% trans "Transfer stock" %}
</a>
</li>
</ul>
</div>
{% endif %}
@ -221,8 +227,8 @@
});
{% if location %}
$("#location-count").click(function() {
function adjustLocationStock(action) {
inventreeGet(
'{% url "api-stock-list" %}',
{
@ -233,7 +239,7 @@
},
{
success: function(items) {
adjustStock('count', items, {
adjustStock(action, items, {
onSuccess: function() {
location.reload();
}
@ -241,6 +247,14 @@
}
}
);
}
$("#location-count").click(function() {
adjustLocationStock('count');
});
$("#location-move").click(function() {
adjustLocationStock('move');
});
$('#print-label').click(function() {