6875d23647fd0676c30f4776c366ba778bf8a194
In some methods, like group expand methods, it is not uncommon to transform a domain designed for model A to search records from another model B. In general this transformation requires two operations: - Rename some fields in the domain - Remove leaves from the domain that relate to fields not existing in model B The current function filter_domain_leaf allows to realize this second operation. It currently relies on a recursive implementation with a complexity of order O(n²). This commit introduces a re-writing of the function filter_domain_leaf that: 1. Changes the recursion based implementation to an explicit stack implementation 2. Introduces a field mapping dictionary as argument The explicit stack implementation allows to avoid stack overflow when working with long domains. The complexity order is also improved to O(n) instead of O(n²) which leads to performance gain. For a domain length of ~100 elements, the gain (timewise) is reaching 50%. It is >95% for domain length over 10 000 elements. The field mapping dictionary allows to avoid pre-filtering of domains when using filter_domain_leaf. In cases where it is used, the domain then just has to be browsed once in the filter_domain_leaf function. task-3299357 closes odoo/odoo#120834 Related: odoo/enterprise#40847 Signed-off-by: Xavier Bol (xbo) <xbo@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%