-
- Downloads
[REF] *mrp*: batch `_bom_find`
Some usage of `_bom_find` are performance bottleneck (one request by product). By example, when the mrp is installed, search products with fields compute by `_compute_quantities` (e.g. 'Negative forecasted quantity'). it is due to the override of `_compute_quantities` in mrp which will make (in the worst case) a `_bom_find` for each product in the DB. To avoid this situation the `_bom_find` method become batched which can handle several products in once. The signature of the method has changed and uniformize in all module. Example performance Gain: ------------------------ In a DB with 7000 products (type 'product'), 500 locations, 1800 BoM, 9000 Stock moves, etc. Search in the tree view with filter "Negative forecasted quantity": Before: 10879 (nb SQL request) 12.67 +- 0.11 sec (Total RPC Time) After: 159 (nb SQL request) 1.82 +- 0.03 sec (Total RPC Time) task-2439019
Showing
- addons/mrp/models/mrp_bom.py 40 additions, 28 deletionsaddons/mrp/models/mrp_bom.py
- addons/mrp/models/mrp_production.py 1 addition, 1 deletionaddons/mrp/models/mrp_production.py
- addons/mrp/models/mrp_unbuild.py 1 addition, 1 deletionaddons/mrp/models/mrp_unbuild.py
- addons/mrp/models/product.py 3 additions, 12 deletionsaddons/mrp/models/product.py
- addons/mrp/models/stock_move.py 1 addition, 1 deletionaddons/mrp/models/stock_move.py
- addons/mrp/models/stock_orderpoint.py 4 additions, 4 deletionsaddons/mrp/models/stock_orderpoint.py
- addons/mrp/models/stock_rule.py 10 additions, 7 deletionsaddons/mrp/models/stock_rule.py
- addons/mrp/populate/mrp.py 2 additions, 2 deletionsaddons/mrp/populate/mrp.py
- addons/mrp_account/models/product.py 2 additions, 2 deletionsaddons/mrp_account/models/product.py
- addons/mrp_subcontracting/models/mrp_bom.py 3 additions, 3 deletionsaddons/mrp_subcontracting/models/mrp_bom.py
- addons/mrp_subcontracting/models/stock_move.py 1 addition, 1 deletionaddons/mrp_subcontracting/models/stock_move.py
- addons/purchase_mrp/models/purchase.py 22 additions, 12 deletionsaddons/purchase_mrp/models/purchase.py
- addons/sale_mrp/models/sale.py 3 additions, 3 deletionsaddons/sale_mrp/models/sale.py
- addons/sale_mrp/tests/test_sale_mrp_flow.py 1 addition, 1 deletionaddons/sale_mrp/tests/test_sale_mrp_flow.py
Loading
Please register or sign in to comment