mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Delete stock tracking entries
This commit is contained in:
parent
118a6887bc
commit
8ca14efa53
@ -344,7 +344,7 @@ function loadStockTrackingTable(table, options) {
|
||||
// Manually created entries can be edited or deleted
|
||||
if (!row.system) {
|
||||
var bEdit = "<button title='Edit tracking entry' class='btn btn-entry-edit btn-default btn-glyph' type='button' url='/stock/track/" + row.pk + "/edit/'><span class='glyphicon glyphicon-edit'/></button>";
|
||||
var bDel = "<button title='Delete tracking entry' class='btn btn-entry-delete btn-default btn-glyph' type='button' pk='" + row.pk + "'><span class='glyphicon glyphicon-trash'/></button>";
|
||||
var bDel = "<button title='Delete tracking entry' class='btn btn-entry-delete btn-default btn-glyph' type='button' url='/stock/track/" + row.pk + "/delete/'><span class='glyphicon glyphicon-trash'/></button>";
|
||||
|
||||
return "<div class='btn-group' role='group'>" + bEdit + bDel + "</div>";
|
||||
} else {
|
||||
@ -376,4 +376,12 @@ function loadStockTrackingTable(table, options) {
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
|
||||
table.on('click', '.btn-entry-delete', function() {
|
||||
var button = $(this);
|
||||
|
||||
launchModalForm(button.attr('url'), {
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
}
|
9
InvenTree/stock/templates/stock/tracking_delete.html
Normal file
9
InvenTree/stock/templates/stock/tracking_delete.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "modal_delete_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
|
||||
<div class='alert alert-danger alert-block'>
|
||||
Are you sure you want to delete this stock tracking entry?
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -31,6 +31,9 @@ stock_tracking_urls = [
|
||||
# edit
|
||||
url(r'^(?P<pk>\d+)/edit/', views.StockItemTrackingEdit.as_view(), name='stock-tracking-edit'),
|
||||
|
||||
# delete
|
||||
url(r'^(?P<pk>\d+)/delete', views.StockItemTrackingDelete.as_view(), name='stock-tracking-delete'),
|
||||
|
||||
# list
|
||||
url('^.*$', views.StockTrackingIndex.as_view(), name='stock-tracking-list')
|
||||
]
|
||||
|
@ -582,6 +582,17 @@ class StockItemDelete(AjaxDeleteView):
|
||||
ajax_form_title = 'Delete Stock Item'
|
||||
|
||||
|
||||
class StockItemTrackingDelete(AjaxDeleteView):
|
||||
"""
|
||||
View to delete a StockItemTracking object
|
||||
Presents a deletion confirmation form to the user
|
||||
"""
|
||||
|
||||
model = StockItemTracking
|
||||
ajax_template_name = 'stock/tracking_delete.html'
|
||||
ajax_form_title = 'Delete Stock Tracking Entry'
|
||||
|
||||
|
||||
class StockTrackingIndex(ListView):
|
||||
"""
|
||||
StockTrackingIndex provides a page to display StockItemTracking objects
|
||||
|
Loading…
Reference in New Issue
Block a user