mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Add support for recursively delete the stock locations (#3926)
This commit is contained in:
@ -171,16 +171,35 @@ function deleteStockLocation(pk, options={}) {
|
||||
var html = `
|
||||
<div class='alert alert-block alert-danger'>
|
||||
{% trans "Are you sure you want to delete this stock location?" %}
|
||||
<ul>
|
||||
<li>{% trans "Any child locations will be moved to the parent of this location" %}</li>
|
||||
<li>{% trans "Any stock items in this location will be moved to the parent of this location" %}</li>
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
|
||||
var subChoices = [
|
||||
{
|
||||
value: 0,
|
||||
display_name: '{% trans "Move to parent stock location" %}',
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
display_name: '{% trans "Delete" %}',
|
||||
}
|
||||
];
|
||||
|
||||
constructForm(url, {
|
||||
title: '{% trans "Delete Stock Location" %}',
|
||||
method: 'DELETE',
|
||||
fields: {
|
||||
'delete_stock_items': {
|
||||
label: '{% trans "Action for stock items in this stock location" %}',
|
||||
choices: subChoices,
|
||||
type: 'choice'
|
||||
},
|
||||
'delete_sub_locations': {
|
||||
label: '{% trans "Action for sub-locations" %}',
|
||||
choices: subChoices,
|
||||
type: 'choice'
|
||||
},
|
||||
},
|
||||
preFormContent: html,
|
||||
onSuccess: function(response) {
|
||||
handleFormSuccess(response, options);
|
||||
|
Reference in New Issue
Block a user