Daily updates from Odoo
Tuesday, January 7, 2025
1 change · saas-17.2
Enhancements to existing features
Point of Sale now caches repeated price calculations when products are added to an order, reducing delays that grew as carts became larger. This makes adding order lines much faster and improves cashier responsiveness during sales.
Original PR description
**Problem:** A customer experiences a noticeable delay (1 to 2 sec) when adding product in the cart because of lack of caching computations. It gets worse the more orderlines are added in the cart.…
**Problem:**
A customer experiences a noticeable delay (1 to 2 sec) when adding product in
the cart because of lack of caching computations. It gets worse the more
orderlines are added in the cart.
**Solution:**
This commit introduces an implementation of lazy reactive computed value that is
pull-based -- it only recomputes when it's needed. Check the following PR in
odoo/owl for its origin: [odoo/owl#1499](https://github.com/odoo/owl/pull/1499)
This can be used for smart-caching selected getters. In this PR, we made a
getter for the `get_all_prices` method and instead of normal getter access, we
get the result of the getter using the `get` method introduced in the wrapper
class.
This means that in one call stack, calling `get('allPrices')` will only run once
and it will keep returning the cached value until a dependency in its
dependency (calculation) graph changed.
With this patch, adding an orderline is now 300ms -- approximate 5 times faster
than without caching.
Related: https://github.com/odoo/enterprise/pull/67382