2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 21:16:46 +00:00

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> <li>
<a href='#' id='part-move'> <a href='#' id='part-move'>
<span class='fas fa-exchange-alt'></span> <span class='fas fa-exchange-alt'></span>
{% trans "Move part stock" %} {% trans "Transfer part stock" %}
</a> </a>
</li> </li>
</ul> </ul>

View File

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