mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1445 from eeintech/simple_stock_table_view
Simplified stock table view in Part and SupplierPart detail pages
This commit is contained in:
commit
6a1bb0a806
@ -22,7 +22,7 @@
|
|||||||
params: {
|
params: {
|
||||||
supplier_part: {{ part.id }},
|
supplier_part: {{ part.id }},
|
||||||
location_detail: true,
|
location_detail: true,
|
||||||
part_detail: true,
|
part_detail: false,
|
||||||
},
|
},
|
||||||
groupByField: 'location',
|
groupByField: 'location',
|
||||||
buttons: ['#stock-options'],
|
buttons: ['#stock-options'],
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
params: {
|
params: {
|
||||||
part: {{ part.id }},
|
part: {{ part.id }},
|
||||||
location_detail: true,
|
location_detail: true,
|
||||||
part_detail: true,
|
part_detail: false,
|
||||||
},
|
},
|
||||||
groupByField: 'location',
|
groupByField: 'location',
|
||||||
buttons: [
|
buttons: [
|
||||||
|
@ -131,6 +131,7 @@ addHeaderAction('stock-to-build', '{% trans "Required for Build Orders" %}', 'fa
|
|||||||
|
|
||||||
loadStockTable($('#table-recently-updated-stock'), {
|
loadStockTable($('#table-recently-updated-stock'), {
|
||||||
params: {
|
params: {
|
||||||
|
part_detail: true,
|
||||||
ordering: "-updated",
|
ordering: "-updated",
|
||||||
max_results: {% settings_value "STOCK_RECENT_COUNT" %},
|
max_results: {% settings_value "STOCK_RECENT_COUNT" %},
|
||||||
},
|
},
|
||||||
|
@ -241,7 +241,6 @@ function loadStockTable(table, options) {
|
|||||||
|
|
||||||
// List of user-params which override the default filters
|
// List of user-params which override the default filters
|
||||||
|
|
||||||
options.params['part_detail'] = true;
|
|
||||||
options.params['location_detail'] = true;
|
options.params['location_detail'] = true;
|
||||||
|
|
||||||
var params = options.params || {};
|
var params = options.params || {};
|
||||||
@ -524,7 +523,8 @@ function loadStockTable(table, options) {
|
|||||||
title: '{% trans "Part" %}',
|
title: '{% trans "Part" %}',
|
||||||
sortName: 'part__name',
|
sortName: 'part__name',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: false,
|
visible: params['part_detail'],
|
||||||
|
switchable: params['part_detail'],
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
var url = `/stock/item/${row.pk}/`;
|
var url = `/stock/item/${row.pk}/`;
|
||||||
@ -543,6 +543,8 @@ function loadStockTable(table, options) {
|
|||||||
title: 'IPN',
|
title: 'IPN',
|
||||||
sortName: 'part__IPN',
|
sortName: 'part__IPN',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
visible: params['part_detail'],
|
||||||
|
switchable: params['part_detail'],
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return row.part_detail.IPN;
|
return row.part_detail.IPN;
|
||||||
},
|
},
|
||||||
@ -550,6 +552,8 @@ function loadStockTable(table, options) {
|
|||||||
{
|
{
|
||||||
field: 'part_detail.description',
|
field: 'part_detail.description',
|
||||||
title: '{% trans "Description" %}',
|
title: '{% trans "Description" %}',
|
||||||
|
visible: params['part_detail'],
|
||||||
|
switchable: params['part_detail'],
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return row.part_detail.description;
|
return row.part_detail.description;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user