Tuesday, January 7, 2025
2 changes · 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/67382Resolved issues and error corrections
This update prevents website live chat from crashing on mobile or small screens when an operator has a custom chat display name. Customers can now start and continue live chat conversations reliably in that scenario.
Original PR description
On small displays, starting a new website livechat with an operator that has an `user_livechat_username` crashes when rendering the username.
Steps to reproduce
-----
1. Select User Menu Icon > My Profile / Preferences > enter an Online Chat Name
2. On a mobile device or small window, open the livechat on the website
3. Send any new message
4. The following traceback occurs
```
Caused by: TypeError: Cannot read properties of undefined (reading 'channel_type')
at get authorName
```
Cause
-----
On small displays, `thread` for the default operator message becomes undefined when it is reassigned to the new thread. This causes an error in `get authorName()` when the undefined `thread` is accessed directly to detemine the displayed username.
Solution
-----
Add an optional chain (?) when accessing `this.message.thread` to handle the possible nullish value.
opw-4446208
Backport of odoo/odoo#192605