Product cost price is not updated when landed cost are added on a supplier shipment.
Recompute cost price method should be executed on all products involved by the moves.
Problem :
If you never call manually the recompute cost price wizard on the product, the landed cost will never
impact the cost price.
>Have you a proposal to minimize the re-computation (because it is expensive)?
Add a cost_price on stock period.
The cost_price must be computed until a specific date (end of stock periode)
-> move search domain should be extracted of the method to be updated.
The compute_cost_price method should use the stock period with the quantity
computed and the cost price of this quantity.
I think it is necessary to group the products associated with the delivery treated by the "landing cost" to perform a "recompute" only on these products.
List the products on the movements of the supplier shipment attached to the "landing cost", group by product, retrieve the calculation method according to the configuration of the product, start the recalculation of the cost price.
I'm not sure this is the best method, but I have no other idea right now.
I think we need a more general design for the re-computation of the cost price of a product.
I think we need to have a table which will store the product/company that need to be recomputed. This table will be filled by modules that changes stock moves after being done (like account_stock_landed_cost).
Then we have a wizard (or a cron) that will re-compute the cost price for all those product and clear the table.
The transactional queue (if we have the funding) [1] may be a better alternative to the previous table.