Daily updates from Odoo
Friday, November 8, 2024
3 changes · 18.0
Enhancements to existing features
User lookup by display name has been adjusted to avoid a slow database search pattern on very large user lists. This restores the previous behavior and can reduce searches from many seconds to milliseconds, improving responsiveness in user-related screens and operations.
Original PR description
After removal of _name_search(), the res.users `_search_display_name()` has been rewritten to use an `OR` to match either exactly the login or part of the name; this make the query very inefficient as it prevent PostgreSQL to use the index an any of the two fields.
This commit re-introduce the previous behavior: we first check for an exact users match on the login or (if none) we fallback to standard display name search (for `name`).
With a database will multiple millions of users:
Before:
```
In [1]: %time env["res.users"].search([('display_name', 'ilike', 'OdooBot')])
CPU times: user 2.03 ms, sys: 8 µs, total: 2.04 ms
Wall time: 16.8 s
```
After:
```
In [1]: %time env["res.users"].search([('display_name', 'ilike', 'OdooBot')])
CPU times: user 1.21 ms, sys: 1.87 ms, total: 3.08 ms
Wall time: 6.69 ms
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe wording shown when an administrator is asked for a password while editing another user's account has been clarified. This reduces confusion during sensitive account management actions and helps admins understand why the prompt appears.
Original PR description
Sometimes admins are asked the password when they modify the account of someone else. The wording shown is a bit confusing. This commit makes the wording more clear. Task-4295458
The time off settings now show a clearer warning when a negative balance limit is set incorrectly. This reduces confusion for users by replacing contradictory wording with a more understandable message.
Original PR description
Before this commit, the error message that the user receives once triggering the constraint on negative balances values was: "The negative amount must be greater than 0." which was a bit confusing by having side to side "negative" and "greater than 0" This commit rephrases that error message.