2
0
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:
Oliver
2023-04-04 00:55:47 +10:00
committed by GitHub
parent 6ebe8c61c5
commit 1622684c22
7 changed files with 99 additions and 3 deletions

View File

@ -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,

View File

@ -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',

View File

@ -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: '',

View File

@ -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,