Wrong cost price shown on product cost history (and used for inventory valuation)
When both product_cost_history and product_cost_fifo are activated the product cost history showns a wrong price when the cost is updated by an outgoing move.
Here are the steps to reproduce:
- Create a product with fifo cost method
- Receive 4 unit at 10€
- Receive 4 unit at 12€
- Check the cost price of the product is 11€ and the cost shown on history is 11€
- Send 3 units of the product
Now the cost price on the product is updated to 11.6€ but on the history is still showing 11€. Also browsing the locations at the current date shows a valuation of 55€ (5units x 11€) while it should be 58€ (5 units x 11.6€)
This was introduced by changeset6542d4065178