mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Render part information in stock item tracking table (if provided)
This commit is contained in:
parent
e5eb1f4513
commit
5240c60e0b
@ -1234,6 +1234,15 @@ class StockTrackingList(generics.ListAPIView):
|
|||||||
if not deltas:
|
if not deltas:
|
||||||
deltas = {}
|
deltas = {}
|
||||||
|
|
||||||
|
# Add part detail
|
||||||
|
if 'part' in deltas:
|
||||||
|
try:
|
||||||
|
part = Part.objects.get(pk=deltas['part'])
|
||||||
|
serializer = PartBriefSerializer(part)
|
||||||
|
deltas['part_detail'] = serializer.data
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# Add location detail
|
# Add location detail
|
||||||
if 'location' in deltas:
|
if 'location' in deltas:
|
||||||
try:
|
try:
|
||||||
|
@ -26,11 +26,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='panel-content'>
|
<div class='panel-content'>
|
||||||
<div id='table-toolbar'>
|
<div id='tracking-table-toolbar'>
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
|
{% include "filter_list.html" with id="stocktracking" %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table class='table table-condensed table-striped' id='track-table' data-toolbar='#table-toolbar'>
|
<table class='table table-condensed table-striped' id='track-table' data-toolbar='#tracking-table-toolbar'>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -342,7 +343,6 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
loadStockTrackingTable($("#track-table"), {
|
loadStockTrackingTable($("#track-table"), {
|
||||||
params: {
|
params: {
|
||||||
ordering: '-date',
|
ordering: '-date',
|
||||||
|
@ -2373,6 +2373,19 @@ function loadStockTrackingTable(table, options) {
|
|||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Part information
|
||||||
|
if (details.part) {
|
||||||
|
html += `<tr><th>{% trans "Part" %}</th><td>`;
|
||||||
|
|
||||||
|
if (details.part_detail) {
|
||||||
|
html += renderLink(details.part_detail.full_name, `/part/${details.part}/`);
|
||||||
|
} else {
|
||||||
|
html += `{% trans "Part information unavailable" %}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += `</td></tr>`;
|
||||||
|
}
|
||||||
|
|
||||||
// Location information
|
// Location information
|
||||||
if (details.location) {
|
if (details.location) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user