> Or maybe it is simpler to forbid to use update wizard if the method is average
With the average cost method, it must be possible to perform a manual price change
because we can imagine the need to integrate additional costs on a product
but that we can not impact a delivery.
We have received different delivery, so we have 1000 products in stock.
Due to a storage problem, we must apply a treatment on these products before being able
to sell them (for example cleaning). We must impact these costs in the cost price and in the stock account.
For this we recalculate a new cost price manually and we use the wizard to apply this difference.
We can not use the notion of "landed cost" in this case,
because the costs must be impacted on all the stock and not on a delivery.
I think merging both wizard will be the solution.
If we link the topic "https://discuss.tryton.org/t/how-to-add-amount-to-account-stock-if-we-add-a-landed-cost-to-a-supplier-shipment"
it is necessary to integrate an imputation in the stock account
of the change of cost after recalculation in the assistant of update of the cost price (value of product added in the stock account).
Current product cost price : 1,5€
Recompute product cost price : 2€ (landing cost integration)
Product cost price difference : 0,5€
Value to be posted to the stock account via the counterpart account: 0,5 € * Qty in stock
Currently the wizard "update_cost_price" only ask the new cost price but
does not take the current cost price to compare it to the cost price calculated by the method "recompute"
This is not a solution.
The cost price change should be stored in such way that the re-compute will reuse the information at the right time.
But on another side, I'm wondering if both wizard should not merge in such way that if the method if average, the only value allowed is this result for the update of the cost price. Or maybe it is simpler to forbid to use update wizard if the method is average and that the recompute wizard run the update wizard to make the update.
The account_stock_continental module allows to update manually the cost price with the wizard wizard_update_cost_price.
But you can also call the "wizard_recompute_cost_price" after and that will erase the previous updated cost price.
The account_stock_continental create account moves with difference between the recomputed cost price and the asked cost price (wizard).
If you recompute the cost price after this, the account stock value is not correct.
Forbid to use "wizard_recompute_cost_price" if there are no stock move since the "wizard_update_cost_price" execution.