mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add action to uninstall a particular stock item
This commit is contained in:
parent
9e4a599c44
commit
1f6cbd7408
@ -107,6 +107,11 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
{% if item.customer %}
|
||||
<li><a href='#' id='stock-return-from-customer' title='{% trans "Return to stock" %}'><span class='fas fa-undo'></span> {% trans "Return to stock" %}</a></li>
|
||||
{% endif %}
|
||||
{% if item.belongs_to %}
|
||||
<li>
|
||||
<a href='#' id='stock-uninstall' title='{% trans "Uninstall stock item" %}'><span class='fas fa-unlink'></span> {% trans "Uninstall" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Edit stock item -->
|
||||
@ -165,8 +170,12 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
{% if item.belongs_to %}
|
||||
<tr>
|
||||
<td><span class='fas fa-box'></span></td>
|
||||
<td>{% trans "Belongs To" %}</td>
|
||||
<td><a href="{% url 'stock-item-detail' item.belongs_to.id %}">{{ item.belongs_to }}</a></td>
|
||||
<td>
|
||||
{% trans "Installed In" %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'stock-item-detail' item.belongs_to.id %}">{{ item.belongs_to }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% elif item.sales_order %}
|
||||
<tr>
|
||||
@ -301,6 +310,19 @@ $("#stock-serialize").click(function() {
|
||||
);
|
||||
});
|
||||
|
||||
$('#stock-uninstall').click(function() {
|
||||
|
||||
launchModalForm(
|
||||
"{% url 'stock-item-uninstall' %}",
|
||||
{
|
||||
data: {
|
||||
'items[]': [{{ item.pk}}],
|
||||
},
|
||||
reload: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("#stock-test-report").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'stock-item-test-report-select' item.id %}",
|
||||
|
@ -128,7 +128,7 @@ $('#installed-table').inventreeTable({
|
||||
|
||||
var html = `<div class='btn-group float-right' role='group'>`;
|
||||
|
||||
html += makeIconButton('fa-trash-alt icon-red', 'button-uninstall', pk, '{% trans "Uninstall item" %}');
|
||||
html += makeIconButton('fa-unlink', 'button-uninstall', pk, '{% trans "Uninstall item" %}');
|
||||
|
||||
html += `</div>`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user