-
- Downloads
[FIX] mrp: change dependency of related field
Fields `product_qty_available` and `product_virtual_available` on stock_move are related on quantities fields of move's product_id. On large database, those two fields will slow down every transactions that updates stock move state (confirmation, validation, ...). `state` on stock.move is a dependent field of computed field `qty_available` on product.product which is dependent field of related field `product_virtual_available` on stock move. This relation tree implies that updating the state on one particular stock move will mark its product (qty_available) as 'to be recomputed' and thus **every** stock moves (product_virtual_available) of this product as to be recomputed. On database will 100k+ stock move per product. Fetching all stock move of some products take 90% of a manufacturing order validation time. This is problematic knowing those two quantity fields are only used in the stock move tree form so computed anyway at the view rendering. This commit change the `depends` of those two related field to mark them as to be recomputed only if the product_id change. Opw: 3047017 Part-of: odoo/odoo#105921
Please register or sign in to comment