f7381c595a239f7d68d0863e081b7a66d8e63354
Improve the performances when searching journal entries filtering by
account.
Steps to reproduce:
* Accounting > Accounting > Journal Items
* Use a name search by account, inputting the code. Do not select the
exact account, but keep the name search.
On large databases, this can take more than a minute, while using the id
of the account directly would take only tens of milliseconds.
This is because when using a domain like
[('account_id', 'like', string)]
it will be translated in SQL as a subquery unable to use a performant
index. Therefore the query planner will use other means and filter on
the account afterwards.
The reason it is not able to find a good index despite there being one
is because char fields are using `unaccent` by default, but the index is
a btree.
Since searching for the account with the code
* only makes sense by prefix
* only uses numbers
We can and should actually use the btree index without the unaccent
feature.
closes odoo/odoo#148583
X-original-commit: 78e2b028d6a04638722edf462f970ebeb29a94ac
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
…
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%