From 7659f2de7bfe2b05fb56147240561c2fdcf4d019 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 5 Sep 2019 19:34:58 +1000 Subject: [PATCH] Click button to validate BOM item --- .../InvenTree/static/script/inventree/bom.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/InvenTree/InvenTree/static/script/inventree/bom.js b/InvenTree/InvenTree/static/script/inventree/bom.js index 2da80c6138..1e66af5c7e 100644 --- a/InvenTree/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/InvenTree/static/script/inventree/bom.js @@ -317,5 +317,22 @@ function loadBomTable(table, options) { } }); }); + + table.on('click', '.bom-validate-button', function() { + var button = $(this); + + var url = '/api/bom/' + button.attr('pk') + '/validate/'; + + inventreePut( + url, + { + valid: true + }, + { + method: 'PATCH', + reloadOnSuccess: true + } + ); + }); } } \ No newline at end of file