2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-30 18:50:53 +00:00

Refactor 'DeleteManufacturerPart' form (#3067)

* Refactor 'DeleteManufacturerPart' form

- Remove duplicated forms
- Update style to match other forms
- Block on each deletion before progressing to the next one

* PEP fix

* Adds deleteSupplierParts function

* Refactor all instances of supplier part deletion

* Refactor tractor : use convenience function for bootstraptable.getSelections

* Add deleter for manufacturerpartparameter.

Refactor existing code into a single function

* Refactor deletion for stock items

* JS linting
This commit is contained in:
Oliver
2022-05-25 23:35:53 +10:00
committed by GitHub
parent 0e9ea1be0c
commit 2d1776a151
19 changed files with 371 additions and 291 deletions

View File

@ -834,12 +834,7 @@ function loadBuildOutputTable(build_info, options={}) {
var subtable = $(`#output-sub-table-${pk}`);
if (subtable.exists()) {
var rows = subtable.bootstrapTable('getSelections');
// None selected? Use all!
if (rows.length == 0) {
rows = subtable.bootstrapTable('getData');
}
var rows = getTableData(`#output-sub-table-${pk}`);
allocateStockToBuild(
build_info.pk,
@ -1291,11 +1286,7 @@ function loadBuildOutputTable(build_info, options={}) {
// Complete multiple outputs
$('#multi-output-complete').click(function() {
var outputs = $(table).bootstrapTable('getSelections');
if (outputs.length == 0) {
outputs = $(table).bootstrapTable('getData');
}
var outputs = getTableData(table);
completeBuildOutputs(
build_info.pk,
@ -1314,11 +1305,7 @@ function loadBuildOutputTable(build_info, options={}) {
// Delete multiple build outputs
$('#multi-output-delete').click(function() {
var outputs = $(table).bootstrapTable('getSelections');
if (outputs.length == 0) {
outputs = $(table).bootstrapTable('getData');
}
var outputs = getTableData(table);
deleteBuildOutputs(
build_info.pk,
@ -1337,11 +1324,7 @@ function loadBuildOutputTable(build_info, options={}) {
// Print stock item labels
$('#incomplete-output-print-label').click(function() {
var outputs = $(table).bootstrapTable('getSelections');
if (outputs.length == 0) {
outputs = $(table).bootstrapTable('getData');
}
var outputs = getTableData(table);
var stock_id_values = [];