diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index 866a6c27e4..f8a6990a24 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -757,7 +757,11 @@ success: function(part) { orderParts( [part], - {} + { + onSuccess: function() { + $("#purchase-order-table").bootstrapTable('refresh'); + } + } ); } } diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index ef3842ad53..f8977f5996 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -1032,7 +1032,7 @@ function exportOrder(redirect_url, options={}) { /* * Create a new form to order parts based on the list of provided parts. */ -function orderParts(parts_list, options={}) { +function orderParts(parts_list, options) { var parts = []; @@ -1162,6 +1162,10 @@ function orderParts(parts_list, options={}) { // If the modal is now "empty", dismiss it if (!($(opts.modal).find('.part-order-row').exists())) { closeModal(opts.modal); + // If there is a onSuccess callback defined, call it + if (options && options.onSuccess) { + options.onSuccess(); + } } }