mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
Adds information on test result being deleted
This commit is contained in:
@ -311,86 +311,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#test-result-table').on('click', '.button-test-tick', function() {
|
||||
var button = $(this);
|
||||
|
||||
var test_name = button.attr('pk');
|
||||
|
||||
inventreePut(
|
||||
'{% url "api-stock-test-result-list" %}',
|
||||
{
|
||||
test: test_name,
|
||||
result: true,
|
||||
stock_item: {{ item.pk }},
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
success: function(response) {
|
||||
reloadTable();
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
$("#test-result-table").on('click', '.button-test-add', function() {
|
||||
var button = $(this);
|
||||
|
||||
var test_name = button.attr('pk');
|
||||
|
||||
constructForm('{% url "api-stock-test-result-list" %}', {
|
||||
method: 'POST',
|
||||
fields: {
|
||||
test: {
|
||||
value: test_name,
|
||||
},
|
||||
result: {},
|
||||
value: {},
|
||||
attachment: {},
|
||||
notes: {},
|
||||
stock_item: {
|
||||
value: {{ item.pk }},
|
||||
hidden: true,
|
||||
}
|
||||
},
|
||||
title: '{% trans "Add Test Result" %}',
|
||||
onSuccess: reloadTable,
|
||||
});
|
||||
});
|
||||
|
||||
$("#test-result-table").on('click', '.button-test-edit', function() {
|
||||
var button = $(this);
|
||||
|
||||
var pk = button.attr('pk');
|
||||
|
||||
var url = `/api/stock/test/${pk}/`;
|
||||
|
||||
constructForm(url, {
|
||||
fields: {
|
||||
test: {},
|
||||
result: {},
|
||||
value: {},
|
||||
attachment: {},
|
||||
notes: {},
|
||||
},
|
||||
title: '{% trans "Edit Test Result" %}',
|
||||
onSuccess: reloadTable,
|
||||
});
|
||||
});
|
||||
|
||||
$("#test-result-table").on('click', '.button-test-delete', function() {
|
||||
var button = $(this);
|
||||
|
||||
var pk = button.attr('pk');
|
||||
|
||||
var url = `/api/stock/test/${pk}/`;
|
||||
|
||||
constructForm(url, {
|
||||
method: 'DELETE',
|
||||
title: '{% trans "Delete Test Result" %}',
|
||||
onSuccess: reloadTable,
|
||||
});
|
||||
});
|
||||
|
||||
{% if item.child_count > 0 %}
|
||||
loadStockTable($("#childs-stock-table"), {
|
||||
params: {
|
||||
|
Reference in New Issue
Block a user