mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Line item links (#4570)
* Add 'link' field to order line and extra line models * Update serializers * Update front end forms and tables
This commit is contained in:
@ -40,6 +40,9 @@ function extraLineFields(options={}) {
|
||||
notes: {
|
||||
icon: 'fa-sticky-note',
|
||||
},
|
||||
link: {
|
||||
icon: 'fa-link',
|
||||
}
|
||||
};
|
||||
|
||||
if (options.order) {
|
||||
@ -318,6 +321,15 @@ function loadExtraLineTable(options={}) {
|
||||
field: 'notes',
|
||||
title: '{% trans "Notes" %}',
|
||||
},
|
||||
{
|
||||
field: 'link',
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'buttons',
|
||||
switchable: false,
|
||||
|
@ -330,6 +330,9 @@ function poLineItemFields(options={}) {
|
||||
notes: {
|
||||
icon: 'fa-sticky-note',
|
||||
},
|
||||
link: {
|
||||
icon: 'fa-link',
|
||||
}
|
||||
};
|
||||
|
||||
if (options.order) {
|
||||
@ -2037,6 +2040,15 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
|
||||
field: 'notes',
|
||||
title: '{% trans "Notes" %}',
|
||||
},
|
||||
{
|
||||
field: 'link',
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
switchable: false,
|
||||
field: 'buttons',
|
||||
|
@ -371,7 +371,10 @@ function returnOrderLineItemFields(options={}) {
|
||||
},
|
||||
notes: {
|
||||
icon: 'fa-sticky-note',
|
||||
}
|
||||
},
|
||||
link: {
|
||||
icon: 'fa-link',
|
||||
},
|
||||
};
|
||||
|
||||
return fields;
|
||||
@ -714,6 +717,15 @@ function loadReturnOrderLineItemTable(options={}) {
|
||||
field: 'notes',
|
||||
title: '{% trans "Notes" %}',
|
||||
},
|
||||
{
|
||||
field: 'link',
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value, row) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'buttons',
|
||||
title: '',
|
||||
|
@ -149,6 +149,9 @@ function soLineItemFields(options={}) {
|
||||
notes: {
|
||||
icon: 'fa-sticky-note',
|
||||
},
|
||||
link: {
|
||||
icon: 'fa-link',
|
||||
}
|
||||
};
|
||||
|
||||
if (options.order) {
|
||||
@ -1868,6 +1871,16 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
||||
title: '{% trans "Notes" %}',
|
||||
});
|
||||
|
||||
columns.push({
|
||||
field: 'link',
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
columns.push({
|
||||
field: 'buttons',
|
||||
switchable: false,
|
||||
|
Reference in New Issue
Block a user