2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

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

View File

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