mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add option to move stock for a part
This commit is contained in:
parent
9fc7976569
commit
2ea4824030
@ -49,9 +49,25 @@
|
|||||||
<span id='part-price-icon' class='fas fa-dollar-sign'/>
|
<span id='part-price-icon' class='fas fa-dollar-sign'/>
|
||||||
</button>
|
</button>
|
||||||
{% if roles.stock.change %}
|
{% if roles.stock.change %}
|
||||||
<button type='button' class='btn btn-default' id='part-count' title='{% trans "Count part stock" %}'>
|
<div class='btn-group'>
|
||||||
<span class='fas fa-clipboard-list'/>
|
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'>
|
||||||
|
<span class='fas fa-boxes'></span> <span class='caret'></span>
|
||||||
</button>
|
</button>
|
||||||
|
<ul class='dropdown-menu'>
|
||||||
|
<li>
|
||||||
|
<a href='#' id='part-count'>
|
||||||
|
<span class='fas fa-clipboard-list'></span>
|
||||||
|
{% trans "Count part stock" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href='#' id='part-move'>
|
||||||
|
<span class='fas fa-exchange-alt'></span>
|
||||||
|
{% trans "Move part stock" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.purchaseable %}
|
{% if part.purchaseable %}
|
||||||
{% if roles.purchase_order.add %}
|
{% if roles.purchase_order.add %}
|
||||||
@ -272,7 +288,7 @@
|
|||||||
printPartLabels([{{ part.pk }}]);
|
printPartLabels([{{ part.pk }}]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#part-count").click(function() {
|
function adjustPartStock(action) {
|
||||||
inventreeGet(
|
inventreeGet(
|
||||||
'{% url "api-stock-list" %}',
|
'{% url "api-stock-list" %}',
|
||||||
{
|
{
|
||||||
@ -284,7 +300,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
success: function(items) {
|
success: function(items) {
|
||||||
adjustStock('count', items, {
|
adjustStock(action, items, {
|
||||||
onSuccess: function() {
|
onSuccess: function() {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@ -292,6 +308,14 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#part-move").click(function() {
|
||||||
|
adjustPartStock('move');
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#part-count").click(function() {
|
||||||
|
adjustPartStock('count');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#price-button").click(function() {
|
$("#price-button").click(function() {
|
||||||
|
@ -59,10 +59,16 @@
|
|||||||
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %}
|
||||||
{% if roles.stock.change %}
|
{% if roles.stock.change %}
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'>
|
||||||
|
<span class='fas fa-boxes'></span> <span class='caret'></span>
|
||||||
|
</button>
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<ul class='dropdown-menu' role='menu'>
|
||||||
<li><a href='#' id='location-count'><span class='fas fa-clipboard-list'></span>
|
<li>
|
||||||
{% trans "Count stock" %}</a></li>
|
<a href='#' id='location-count'>
|
||||||
|
<span class='fas fa-clipboard-list'></span>
|
||||||
|
{% trans "Count stock" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user