Thursday, February 16, 2023
9 changes · master
Enhancements to existing features
Odoo’s internal search logic has been redesigned to make complex filtering easier to express and more efficient to process. This helps core apps run cleaner database queries and enables more advanced business searches, especially across related records such as orders, tags, activities, and products.
Original PR description
The main goal is to rationalize the use of operators to simplify query generation and to make it possible to run optimizations to send a more efficient query to the database. Domain rewriting and…
The main goal is to rationalize the use of operators to simplify query generation and to make it possible to run optimizations to send a more efficient query to the database. Domain rewriting and optimization is separated from query generation which accepts a fixed set of operators.
The main new introduced operator is **any** (and its inverse **none**) which apply to relational fields: these are quantifiers which have as a value another domain that will be applied on the comodel.
It allows to specify domains which were not possible to express before:
- which res.partner has a confirmed order where the price > 1000
`[('sale_order_ids', 'any', [('state', '=', 'sale'), ('amount_total', '>', 1000)])]`
- which res.partner does not have a tag 'x'
`[('category_id, 'none', [('name', '=', 'x')])]`
- which res.partner have or don't have expired quotations
The internal representation of domains as polish-notation lists is handy for serializing them. The new implementation uses a Domain class to represent domains which is backwards-compabile with the polish notation. To build domains, there is a D() builder function and you can still use AND() and OR() or infix operators.
The Domain instances should be considered as immutable.
list(D(some_domain)) # normalized some_domain
D('a', '=', 1) | ~D('b', '=', 2) == D(['|', ('a', '=', 1), '!', ('b', '=', 2)])
New operators can be added, check the 'ref' operator for an example. The new API is used in some core modules to show can what is possible. At the same time, we have an `unaccent` implementation in python for filtered_domain.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prProject recurring tasks now use hidden templates so users can delete or archive individual tasks without accidentally breaking future recurrences. Users also get clearer options to continue or stop a recurrence, making recurring work easier to manage in common cases like skipped meetings or ended routines.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The invoice Send & Print process has been streamlined to make it clearer and faster for users. It avoids unnecessary PDF regeneration, better prepares electronic document actions, and reorganizes the workflow so invoice delivery is easier to manage.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The accounting report queries have been optimized to reduce unnecessary database scanning. This should make reports such as Trial Balance load faster, especially for companies with large account lists.
Original PR description
Without `auto_join=True` a query the Trial Balance report has extra tables scanning because of the following where condition: ``` "account_move_line"."account_id" in ( SELECT "account_account".id…
Without `auto_join=True` a query the Trial Balance report has extra tables
scanning because of the following where condition:
```
"account_move_line"."account_id" in (
SELECT
"account_account".id
FROM
"account_account"
WHERE
(
"account_account"."user_type_id" in (
SELECT
"account_account_type".id
FROM
"account_account_type"
WHERE
(
"account_account_type"."include_initial_balance" IS NULL
or "account_account_type"."include_initial_balance" = false
)
)
)
AND (
"account_account"."company_id" IS NULL
OR (
"account_account"."company_id" in (1)
)
)
)
```
---
task-2743905
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe Dutch localization now uses current VAT rates and more accurate accounting mappings for stock valuation, input/output accounts, tax groups, and fiscal positions. This helps Dutch companies produce more reliable accounting records and avoids outdated or invalid tax options.
Original PR description
…position, tax group --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Knowledge article cover images can now be adjusted vertically so important parts of the image remain visible instead of being awkwardly cropped. This gives users more control over how articles look, while keeping the feature off mobile where covers already display fully.
Original PR description
Purpose: -------- Covers have a non-standard format and often end up badly positioned (not showing the image's main object or cropping it). One can now reposition the image (vertically) to alleviate this issue, using the `reposition cover` button, and then dragging the image. This is not available on mobile devices, because the covers are entirely displayed on small screens (and can therefore not be repositioned). Specs: ------ Cover images are displayed using the `object-position` property, allowing to specify the position of the images inside their own content boxes (eg. a value of `50% 50%` centers the image). `knowledge.cover` model has a new field `height`, used to store the vertical position of the image (percentage value, `default=50`). This height value is used in the templates to set the `object position` property, so that the cover is rendered correctly, without flicker to reposition it. Task-3040156
Financial reports now filter accounting records more directly, avoiding unnecessary database work. This improves report loading performance significantly, especially for companies with large volumes of accounting entries.
Original PR description
Before there were where-condition that requires extra table scanning ``` ... AND ( "account_aged_receivable"."account_id" in ( SELECT "account_account".id FROM "account_account" WHERE (…
Before there were where-condition that requires extra table scanning
```
...
AND (
"account_aged_receivable"."account_id" in (
SELECT
"account_account".id
FROM
"account_account"
WHERE
(
"account_account"."internal_type" = 'receivable'
)
AND (
"account_account"."company_id" IS NULL
OR (
"account_account"."company_id" in (
1
)
)
)
)
)
```
Benchmarks for a dummy DB with 1M account.move.line records:
total time for `get_report_informations` drops from 1500 ms to 150 ms
---
task-2737991Resolved issues and error corrections
User logins that are typically email addresses are now checked without regard to uppercase or lowercase letters. This prevents duplicate accounts using the same email in different casing, avoiding confusion with notification preferences and profile settings.
Original PR description
login field is usually used for email. The email addresses are case insensitive, so xxx@example.com and XXX@example.com should be considered as the same. Previous implimentation was case sensitive, which may lead to a confusion on the following scenario: * create two users with the same email typed in a different cases * merge related partners * ping the user in a chatter * RESULT: notification settings (email/inbox) are used from the first user, which might be different from what user sees in their Profile settings opw-2908939
Point of Sale now records sales of product kits using the kit's own expense account instead of the accounts from its individual components. This keeps POS accounting consistent with Sales and helps ensure costs are reported under the right product category.
Original PR description
If kit's category has different expense account than its components, then we should use kit's account. Such logic is already done in the Sales app, however before this commit the component's settings were used on selling via POS. opw-2930819 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr