Friday, February 20, 2026
1 change · 19.0
Enhancements to existing features
The Stock Valuation report now runs much faster for businesses with large product, stock movement, and sales order volumes. This reduces long wait times and lowers the risk of memory errors when reviewing inventory value.
Original PR description
Problem: When there are many products, stock moves, and sale orders, running the Stock Valuation report can take several minutes, or result in a memory error. This is caused by 2 things: 1. `_compute_goods_delivered_not_invoiced` repeatedly runs `filtered` on a large volume of sale order lines 2. `company.stock_value()`, which recomputes every product's total value, is called twice Solution: We will reduce the memory usage by only fetching the `order_id` on the sale order lines, and speed things up by replacing the `filtered` call with a more intentional `search_fetch`. We will also add a way to circumvent the second `stock_value()` call in `_get_stock_valuation_account_vals`, since it is the same as the first call. Benchmarks: | Products | Stock Moves | Sale Order Lines | Before | After | |---|---|---|---|---| |9,278|228,066|203,403|7.2min|32.32s| A 93% speed improvement. opw-5472879