mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #482 from SchrodingersGat/tweakies
Various UI Tweaks
This commit is contained in:
commit
27798cd4ad
@ -55,6 +55,7 @@ InvenTree | Supplier List
|
|||||||
{
|
{
|
||||||
field: 'description',
|
field: 'description',
|
||||||
title: 'Description',
|
title: 'Description',
|
||||||
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'website',
|
field: 'website',
|
||||||
@ -69,6 +70,7 @@ InvenTree | Supplier List
|
|||||||
{
|
{
|
||||||
field: 'part_count',
|
field: 'part_count',
|
||||||
title: 'Parts',
|
title: 'Parts',
|
||||||
|
sortable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return renderLink(value, row.url + 'parts/');
|
return renderLink(value, row.url + 'parts/');
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,10 @@
|
|||||||
<div class='alert alert-block alert-info'>
|
<div class='alert alert-block alert-info'>
|
||||||
This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted.
|
This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted.
|
||||||
</div>
|
</div>
|
||||||
|
{% elif item.delete_on_deplete %}
|
||||||
|
<div class='alert alert-block alert-warning'>
|
||||||
|
This stock item will be automatically deleted when all stock is depleted.
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -221,6 +225,7 @@
|
|||||||
item: {{ item.id }},
|
item: {{ item.id }},
|
||||||
},
|
},
|
||||||
reload: true,
|
reload: true,
|
||||||
|
follow: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ from django.views.generic.edit import FormMixin
|
|||||||
from django.views.generic import DetailView, ListView
|
from django.views.generic import DetailView, ListView
|
||||||
from django.forms.models import model_to_dict
|
from django.forms.models import model_to_dict
|
||||||
from django.forms import HiddenInput
|
from django.forms import HiddenInput
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
@ -310,6 +311,19 @@ class StockAdjust(AjaxView, FormMixin):
|
|||||||
|
|
||||||
data['success'] = result
|
data['success'] = result
|
||||||
|
|
||||||
|
# Special case - Single Stock Item
|
||||||
|
# If we deplete the stock item, we MUST redirect to a new view
|
||||||
|
single_item = len(self.stock_items) == 1
|
||||||
|
|
||||||
|
if result and single_item:
|
||||||
|
|
||||||
|
# Was the entire stock taken?
|
||||||
|
item = self.stock_items[0]
|
||||||
|
|
||||||
|
if item.quantity == 0:
|
||||||
|
# Instruct the form to redirect
|
||||||
|
data['url'] = reverse('stock-index')
|
||||||
|
|
||||||
return self.renderJsonResponse(request, form, data=data)
|
return self.renderJsonResponse(request, form, data=data)
|
||||||
|
|
||||||
def do_action(self):
|
def do_action(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user