Tryton - Issues

 

Issue7271

Title Recompute cost price after landed cost
Priority feature Status testing
Superseder Nosy List ced, mrichez, reviewbot, tbruyere
Type feature request Components account_stock_landed_cost
Assigned To ced Keywords review
Reviews 260381003
View: 260381003

Created on 2018-03-27.15:41:59 by tbruyere, last changed by reviewbot.

Messages
review260381003 updated at https://codereview.tryton.org/260381003/#ps288481002
review260381003 updated at https://codereview.tryton.org/260381003/#ps264551002
review260381003 updated at https://codereview.tryton.org/260381003/#ps254581003
review260381003 updated at https://codereview.tryton.org/260381003/#ps254581002
review260381003 updated at https://codereview.tryton.org/260381003/#ps284351003
msg52266 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-03.09:53:22
This feature appears in this general proposal: https://discuss.tryton.org/t/update-re-computed-cost-price-on-moves/1802
msg39528 (view) Author: [hidden] (tbruyere) Date: 2018-03-29.11:23:22
>The transactional queue (if we have the funding) [1] may be a better alternative to the previous table.

Yes, I think it would be the best way to recalculate the cost price.
I hope this feature will be possible to develop.
to be continued...
msg39517 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-28.20:18:41
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.

[1] https://discuss.tryton.org/t/transactional-queue/461
msg39474 (view) Author: [hidden] (tbruyere) Date: 2018-03-28.10:00:12
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.
msg39459 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-27.16:53:31
I do not think the cost price computation should be changed. Using stock period will just make the code more complex and error prone.

I'm talking about a strategy to recompute the right products in an efficient way when landed cost has been applied.
msg39457 (view) Author: [hidden] (tbruyere) Date: 2018-03-27.16:47:39
>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.
msg39454 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-27.16:16:02
This is documented in http://hg.tryton.org/modules/account_stock_landed_cost/file/c8724dbd90ca/doc/index.rst#l24
So for me, it is not a bug but just a feature.
Have you a proposal to minimize the re-computation (because it is expensive)?
msg39449 (view) Author: [hidden] (tbruyere) Date: 2018-03-27.15:41:58
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.

Linked to this issue : https://bugs.tryton.org/issue4729
History
Date User Action Args
2019-11-08 18:59:53reviewbotsetmessages: + msg53108
2019-11-07 16:26:12reviewbotsetmessages: + msg53079
2019-11-06 11:02:05reviewbotsetmessages: + msg53061
2019-11-06 10:04:16reviewbotsetmessages: + msg53059
2019-11-05 17:01:31reviewbotsetnosy: + reviewbot
messages: + msg53042
2019-11-05 16:51:58cedsetstatus: chatting -> testing
reviews: 260381003
keyword: + review
assignedto: ced
2019-10-03 09:53:22cedsetmessages: + msg52266
2018-03-29 11:23:22tbruyeresetmessages: + msg39528
2018-03-28 20:18:41cedsetmessages: + msg39517
2018-03-28 10:00:12tbruyeresetmessages: + msg39474

Showing 10 items. Show all history (warning: this could be VERY long)