Reload purchase order table after part order (#4219)

* Reload purchase order table after part order

When on the part page, going to the "Purchase order" sidebar tab.
You can order the part by pressing the "Order Part" button.
After a succefull order, the form closes but the table on the page
was never refreshed.

* Fixed a js styling check error
This commit is contained in:
bloemp authored and GitHub committed 2023-01-25 09:32:17 +11:00
1 parent 1862904a2f
commit 11f147fd34
2 files changed
+10 -2

No files matched your search

+5 -1
View File
@@ -757,7 +757,11 @@
success: function(part) {
orderParts(
[part],
{}
{
onSuccess: function() {
$("#purchase-order-table").bootstrapTable('refresh');
}
}
);
}
}
+5 -1
View File
@@ -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();
}
}
}