For now when a FIFO product is returned, we use the current cost price of this product. So this means that when it will be shipped again, we will use the cost price of the product when it was returned.
This may not be very good especially if the cost price was 0 because there was no product in stock at the moment of return.
Indeed we should use the cost price that was used when the product was shipped. This can be done by using the sale and line origins.
For the exceptional case a returned move is done without being linked to a sale return, we can still use the current cost price. But we should allow to customize this behavior using an extendable method.