Friday, June 14, 2024
1 change · saas-17.1
Enhancements to existing features
Point of Sale now avoids repeated price data lookups when opening a session. This can significantly reduce loading time for stores with many products and price list rules, improving cashier readiness and overall responsiveness.
Original PR description
In `computeProductPricelistCache` there are lots of calls to item.raw/product.raw. These calls are located inside nested for loop so the property `raw` is called on average `O(len(products) * len(pricelistItems)`. Because this property is fixed during the loop iterations, this commit introduces two small maps at the beginning of the function to store the raw property of `pricelistItems` and `products`. That way, you only call the property `O(len(products) + len(pricelistItems))`, leading to an overall speedup of the function, especially when there are lots of products and pricelistItems to load at the opening of a pos.session. #### speedup Customer database with 1001 products and 1993 pricelistItems. JS scripting time at session opening: - 25s -> 6s. opw-3878882 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr