Shipments costs are duplicated when doing partial delivery
I found this on 5.8 series, when using the sale_shipment_cost in case of partial delivery, the invoice of the second shipment is created with two shipment_cost_lines.
After some debuging I found that the problem is cost_invoice_line is not correctly save on shipment, so on each invoice a line is created for each shipment sent.