Initial work toward fixing stock issues

This commit is contained in:
Oliver Walters 2019-05-29 01:03:21 +10:00
parent d512232aac
commit 6a30485a4e
2 changed files with 14 additions and 4 deletions

View File

@ -282,7 +282,7 @@ function moveStockItems(items, options) {
for (i = 0; i < response.length; i++) {
var loc = response[i];
html += makeOption(loc.pk, loc.name + ' - <i>' + loc.description + '</i>');
html += makeOption(loc.pk, loc.pathstring + ' - <i>' + loc.description + '</i>');
}
html += "</select><br>";
@ -312,10 +312,18 @@ function moveStockItems(items, options) {
var item = items[i];
var name = item.part__IPN;
if (name) {
name += ' | ';
}
name += item.part__name;
html += "<tr>";
html += "<td>" + item.part.full_name + "</td>";
html += "<td>" + item.location.pathstring + "</td>";
html += "<td>" + name + "</td>";
html += "<td>" + item.location__path + "</td>";
html += "<td>" + item.quantity + "</td>";
html += "<td>";

View File

@ -278,13 +278,15 @@ class StockList(generics.ListCreateAPIView):
'notes',
'location',
'location__name',
'location__description',
'part',
'part__IPN',
'part__name',
'part__description',
'part__image',
'part__category',
'part__category__name'
'part__category__name',
'part__category__description',
)
# Reduce the number of lookups we need to do for categories