9353a6f9ba81926c7002b3ca5b53ac66fed9aebd
Most of the time, rates are computed in a loop by using `<res.currency>._convert`. This leads to a lot of round trips with the database. This PR is caching the value for a whole transaction. In order to do that, the non stored field `rate` has new (missing) contextual dependencies: the arguments of `_get_conversion_rate`. This allows to move the actual computation of the rate to the computed field, and `_get_conversion_rate` is now only a proxy to avoid playing with the context manually; also kept for backward compatibility. Other solutions were considered: * `ormcache`, but we want to avoid creating multiple caches and reduce the possibility to have inter dependent caches. * managing a local cache everywhere, which is cumbersome and error prone * a helper for the previous option by using a converter factory, but it is still an issue when the convert function is called from multiple call functions because the cache isn't shared then. Part-of: odoo/odoo#137609
…
…
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%