Tryton - Issues

 

Issue6626

Title Improve performance of average cost price
Priority feature Status resolved
Superseder Allow use save of MultiValueMixin.set_multivalue, Move._update_product_cost_price uses wrong quantity for computation
View: 6625, 6627
Nosy List ced, reviewbot, roundup-bot
Type performance Components product_cost_fifo, stock
Assigned To ced Keywords review
Reviews 36431002,42501002
View: 36431002, 42501002

Created on 2017-07-05.19:00:54 by ced, last changed by roundup-bot.

Messages
New changeset 2969908fb327 by Cédric Krier in branch 'default':
Improve performance of cost price computation
http://hg.tryton.org/modules/product_cost_fifo/rev/2969908fb327
New changeset 9b49590277df by Cédric Krier in branch 'default':
Improve performance of average cost price computation
http://hg.tryton.org/modules/stock/rev/9b49590277df
review36431002 updated at https://codereview.tryton.org/36431002/#ps100001
review36431002 updated at https://codereview.tryton.org/36431002/#ps80001
review42501002 updated at https://codereview.tryton.org/42501002/#ps40001
review36431002 updated at https://codereview.tryton.org/36431002/#ps60001
review36431002 updated at https://codereview.tryton.org/36431002/#ps40001
review36431002 updated at https://codereview.tryton.org/36431002/#ps20001
review42501002 updated at https://codereview.tryton.org/42501002/#ps20001
review42501002 updated at https://codereview.tryton.org/42501002/#ps1
review36431002 updated at https://codereview.tryton.org/36431002/#ps1
msg34491 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-07-05.19:38:50
Here is review36431002 and review42501002
msg34487 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-07-05.19:00:53
The do method is written to be sequential because it depends on the status of previous moves. But indeed this constraint is only there is case we process two moves with the same product. So we could save the changes only once we process for the second times the same product.
Also the method _update_product_cost_price does many slow things:
- It writes the cost_price computed, this could be delay later and written with a batch call.
- It instantiates a new product with a specific context, it will be better to process all moves with the same context to get batch computation.
- The product quantity is computed on all storage locations but the most common case is to have one warehouse with all storage inside. So we could request to compute for warehouses and storage outside warehouses. This will allow to benefit from the computation shortcut in Move.compute_quantities.
History
Date User Action Args
2017-08-02 23:04:48roundup-botsetmessages: + msg34997
2017-08-02 23:03:49roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg34996
2017-08-02 22:59:13cedsetsuperseder: + Move._update_product_cost_price uses wrong quantity for computation, - Improve performance of average cost price
2017-08-02 22:59:13cedunlinkissue6626 superseder
2017-07-27 13:41:30reviewbotsetmessages: + msg34838
2017-07-27 13:04:38reviewbotsetmessages: + msg34835
2017-07-27 00:04:23reviewbotsetmessages: + msg34815
2017-07-27 00:04:16reviewbotsetmessages: + msg34814
2017-07-12 20:05:38reviewbotsetmessages: + msg34570
2017-07-10 17:34:59reviewbotsetmessages: + msg34521

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