mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix rendering of PurchaseOrder table
This commit is contained in:
parent
99fcbcc646
commit
746e9ab983
@ -104,21 +104,23 @@ function removePurchaseOrderLineItem(e) {
|
|||||||
function loadPurchaseOrderTable(table, options) {
|
function loadPurchaseOrderTable(table, options) {
|
||||||
/* Create a purchase-order table */
|
/* Create a purchase-order table */
|
||||||
|
|
||||||
var params = options.params || {};
|
options.params = options.params || {};
|
||||||
|
|
||||||
|
options.params['supplier_detail'] = true;
|
||||||
|
|
||||||
var filters = loadTableFilters("order");
|
var filters = loadTableFilters("order");
|
||||||
|
|
||||||
for (var key in params) {
|
for (var key in options.params) {
|
||||||
filters[key] = params[key];
|
filters[key] = options.params[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
setupFilterList("order", table);
|
setupFilterList("order", $(table));
|
||||||
|
|
||||||
$(table).inventreeTable({
|
$(table).inventreeTable({
|
||||||
url: options.url,
|
url: options.url,
|
||||||
queryParams: filters,
|
queryParams: filters,
|
||||||
groupBy: false,
|
groupBy: false,
|
||||||
original: params,
|
original: options.params,
|
||||||
formatNoMatches: function() { return "No purchase orders found"; },
|
formatNoMatches: function() { return "No purchase orders found"; },
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -131,15 +133,15 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
field: 'reference',
|
field: 'reference',
|
||||||
title: 'Purchase Order',
|
title: 'Purchase Order',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return renderLink(value, "/order/purchase-order/" + row.pk + "/");
|
return renderLink(value, `/order/purchase-order/${row.pk}/`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'supplier',
|
field: 'supplier_detail',
|
||||||
title: 'Supplier',
|
title: 'Supplier',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return imageHoverIcon(row.supplier__image) + renderLink(row.supplier__name, '/company/' + value + '/purchase-orders/');
|
return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -162,7 +164,7 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'lines',
|
field: 'line_items',
|
||||||
title: 'Items'
|
title: 'Items'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -48,6 +48,9 @@ class POSerializer(InvenTreeModelSerializer):
|
|||||||
|
|
||||||
fields = [
|
fields = [
|
||||||
'pk',
|
'pk',
|
||||||
|
'issue_date',
|
||||||
|
'complete_date',
|
||||||
|
'creation_date',
|
||||||
'description',
|
'description',
|
||||||
'line_items',
|
'line_items',
|
||||||
'link',
|
'link',
|
||||||
|
Loading…
Reference in New Issue
Block a user