mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
SalesOrderShipment improvements (#3058)
* Adds two new fields to SalesOrderShipment model: - Invoice number (char) - Link (URL) * Bump API version * Update API / serializer / JS - Allow entry of new fields at time of shipping * PEP fixes * Actually fix the PEP issues * Unit testing: check some more fields
This commit is contained in:
@ -55,6 +55,12 @@ function salesOrderShipmentFields(options={}) {
|
||||
tracking_number: {
|
||||
icon: 'fa-hashtag',
|
||||
},
|
||||
invoice_number: {
|
||||
icon: 'fa-dollar-sign',
|
||||
},
|
||||
link: {
|
||||
icon: 'fa-link',
|
||||
}
|
||||
};
|
||||
|
||||
// If order is specified, hide the order field
|
||||
@ -129,11 +135,20 @@ function completeShipment(shipment_id, options={}) {
|
||||
method: 'POST',
|
||||
title: `{% trans "Complete Shipment" %} ${shipment.reference}`,
|
||||
fields: {
|
||||
tracking_number: {
|
||||
value: shipment.tracking_number,
|
||||
},
|
||||
shipment_date: {
|
||||
value: moment().format('YYYY-MM-DD'),
|
||||
},
|
||||
tracking_number: {
|
||||
value: shipment.tracking_number,
|
||||
icon: 'fa-hashtag',
|
||||
},
|
||||
invoice_number: {
|
||||
value: shipment.invoice_number,
|
||||
icon: 'fa-dollar-sign',
|
||||
},
|
||||
link: {
|
||||
value: shipment.link,
|
||||
icon: 'fa-link',
|
||||
}
|
||||
},
|
||||
preFormContent: html,
|
||||
@ -2445,10 +2460,26 @@ function loadSalesOrderShipmentTable(table, options={}) {
|
||||
field: 'tracking_number',
|
||||
title: '{% trans "Tracking" %}',
|
||||
},
|
||||
{
|
||||
field: 'invoice_number',
|
||||
title: '{% trans "Invoice" %}',
|
||||
},
|
||||
{
|
||||
field: 'link',
|
||||
title: '{% trans "Link" %}',
|
||||
formatter: function(value) {
|
||||
if (value) {
|
||||
return renderLink(value, value);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'notes',
|
||||
title: '{% trans "Notes" %}',
|
||||
visible: false,
|
||||
switchable: false,
|
||||
// TODO: Implement 'notes' field
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user