Added onSuccess support to completeShipment

This commit is contained in:
Maksim Stojkovic 2022-05-20 20:37:23 +10:00
parent af0901d06c
commit b99a9306ce

View File

@ -126,7 +126,7 @@ function completeShipment(shipment_id, options={}) {
constructForm(`/api/order/so/shipment/${shipment_id}/ship/`, { constructForm(`/api/order/so/shipment/${shipment_id}/ship/`, {
method: 'POST', method: 'POST',
title: '{% trans "Complete Shipment" %}', title: `{% trans "Complete Shipment" %} ${shipment.reference}`,
fields: { fields: {
tracking_number: {}, tracking_number: {},
}, },
@ -138,6 +138,10 @@ function completeShipment(shipment_id, options={}) {
$('#so-lines-table').bootstrapTable('refresh'); $('#so-lines-table').bootstrapTable('refresh');
$('#pending-shipments-table').bootstrapTable('refresh'); $('#pending-shipments-table').bootstrapTable('refresh');
$('#completed-shipments-table').bootstrapTable('refresh'); $('#completed-shipments-table').bootstrapTable('refresh');
if (options.onSuccess instanceof Function) {
options.onSuccess(data);
}
}, },
reload: !!options.reload reload: !!options.reload
}); });