mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 11:40:58 +00:00
"Validate BOM" now uses the API also
This commit is contained in:
@ -40,6 +40,7 @@
|
||||
loadStockPricingChart,
|
||||
partStockLabel,
|
||||
toggleStar,
|
||||
validateBom,
|
||||
*/
|
||||
|
||||
/* Part API functions
|
||||
@ -429,9 +430,34 @@ function toggleStar(options) {
|
||||
}
|
||||
|
||||
|
||||
/* Validate a BOM */
|
||||
function validateBom(part_id, options={}) {
|
||||
|
||||
var html = `
|
||||
<div class='alert alert-block alert-success'>
|
||||
{% trans "Validating the BOM will mark each line item as valid" %}
|
||||
</div>
|
||||
`;
|
||||
|
||||
constructForm(`/api/part/${part_id}/bom-validate/`, {
|
||||
method: 'PUT',
|
||||
fields: {
|
||||
valid: {},
|
||||
},
|
||||
preFormContent: html,
|
||||
title: '{% trans "Validate Bill of Materials" %}',
|
||||
reload: options.reload,
|
||||
onSuccess: function(response) {
|
||||
showMessage('{% trans "Validated Bill of Materials" %}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* Duplicate a BOM */
|
||||
function duplicateBom(part_id, options={}) {
|
||||
constructForm(`/api/part/${part_id}/copy-bom/`, {
|
||||
|
||||
constructForm(`/api/part/${part_id}/bom-copy/`, {
|
||||
method: 'POST',
|
||||
fields: {
|
||||
part: {
|
||||
|
Reference in New Issue
Block a user