Issue 10206

Wrong cost price shown on product cost history (and used for inventory valuation)
Nosy list
ced, pokoli
Assigned to

Created on 2021-03-17.15:51:36 by pokoli, last changed 5 months ago by ced.


Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-04-25.18:46:59

For me it is a border case because in FIFO the last cost_price computed is only stored on the outgoing moves. But the history takes only the incoming moves as source.
I guess we could include also the outgoing moves in the history query (even if it will slow down the query). (Maybe it can be done only if product_cost_fifo is activated).

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-03-17.16:47:28

El 17/3/21 a les 16:04, Cédric Krier ha escrit:

Cédric Krier added the comment:

Did the recompute_cost_price run?

No, but running them does not fix the issue.
What I've done:

  1. Use the recompute cost price wizard from the variant
  2. Run the schedule task to recompute cost price from moves

None of the options fixed the issue as it do not produce any change to the cost price nor the history.
Should I do something else?

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-03-17.16:04:02

Did the recompute_cost_price run?

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-03-17.15:51:35

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:

  1. Create a product with fifo cost method
  2. Receive 4 unit at 10€
  3. Receive 4 unit at 12€
  4. Check the cost price of the product is 11€ and the cost shown on history is 11€
  5. 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 changeset 6542d4065178

Date User Action Args
2021-04-25 18:46:59cedsetmessages: + msg66952
2021-03-17 16:47:28pokolisetmessages: + msg65601
status: need-eg -> chatting
2021-03-17 16:04:02cedsetmessages: + msg65598
nosy: + ced
status: unread -> need-eg
2021-03-17 15:51:36pokolicreate