Daily updates from Odoo
Friday, January 26, 2024
5 changes · master
Enhancements to existing features
Odoo now avoids repeated language checks during common cached reads, improving performance for translated content. It also validates languages when creating, updating, or fetching translated fields, reducing the risk of data being handled in the wrong fallback language.
Original PR description
[IMP] core: better lang check Before this commit, we check if language is valid and active when `env.lang`. 1. SQL f'->>{env.lang}' is safe 2. `env.lang` is frequently called and slow This commit a)…
[IMP] core: better lang check
Before this commit, we check if language is valid and active when `env.lang`.
1. SQL f'->>{env.lang}' is safe
2. `env.lang` is frequently called and slow
This commit
a) removes language check for `env.lang` to improve performance.
The field value reading time for translated field is reduced by 50% when the
field value has been cached.
b) adds language check when necessary
currently when you read/write in inactive or invalid language, you will actually
read/write in en_US. It would be safer to raise an error instead of doing
everything in en_US especially when some rpc read/write script forgets a
language is inactivated in the server
For feature, the added language validation happens when
1. `write` translated fields
2. `create` records with translated fields
3. `fetch` field values for translated fields
For performance the added language validation shouldn't happen when
1. `read` cached translated field value
c) for sake of a) the `env.lang` is not safe anymore
the following commits refactor SQL queries to avoid SQL injection with the help
of `_field_to_sql`
https://github.com/odoo/odoo/pull/142814Planning settings now clearly separate shift swapping from employees unassigning themselves, making it easier for managers to choose the right behavior. Future-dated timesheets are also hidden from validation menus to avoid showing work items that cannot yet be approved.
Original PR description
Before this commit, it was not clear to users that the 'switch shifts' feature existed, and that is it mutually exclusive with the 'allow unassignment' option in the settings. To make things clear, this commit splits the 'allowing unassignment' setting in two: - The 'switch shifts with other employees' option which corresponds to the current behavior when the 'allow unassignment' feature is disabled. It is the default value. - The 'unassignment themselves from shifts' option which corresponds to the current behavior when the 'allow unassignment' feature is enabled. task-3703648
The GSTR return period form now hides the tax unit option when no tax unit is available. This keeps the form cleaner and avoids showing users an irrelevant choice.
Original PR description
In this PR ------------- **[IMP] l10n_in_reports_gstr: hide tax unit if not available** - This commits hides the tax unit for gstr return period form if no tax unit is available task-3679488
Financial reports now include an option to display amounts in thousands, making large figures easier to read and compare. This helps users review high-level financial results more quickly without changing the underlying data.
Original PR description
Add an option/filter to display amount in thousands. task-3626894
The online sales templates for rentals and subscriptions were simplified after related product page caching was removed. This keeps the website sales experience aligned with platform changes and should make future maintenance easier without changing visible business workflows.
Original PR description
Now that the cache has been removed from product page, those templates (or part of) can be simplified. See also: https://github.com/odoo/odoo/pull/145532 https://github.com/odoo/upgrade/pull/5422