2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Adds simply endpoint for BOM duplication

This commit is contained in:
Oliver
2021-12-21 17:16:27 +11:00
parent 09777c5764
commit 0c8a047bc2
8 changed files with 102 additions and 111 deletions

View File

@ -21,6 +21,7 @@
*/
/* exported
duplicateBom,
duplicatePart,
editCategory,
editPart,
@ -428,6 +429,29 @@ function toggleStar(options) {
}
/* Duplicate a BOM */
function duplicateBom(part_id, options={}) {
constructForm(`/api/part/${part_id}/copy-bom/`, {
method: 'POST',
fields: {
part: {
icon: 'fa-shapes',
filters: {
assembly: true,
ancestor: part_id,
}
},
remove_existing: {
value: true,
},
},
confirm: true,
title: '{% trans "Copy Bill of Materials" %}',
});
}
function partStockLabel(part, options={}) {
if (part.in_stock) {