76a44b29f5a3765bb6462fbe6e129718206d63c6
When rendering the list view, we evaluate the evalContext for each field so that we can give it infos such as readonly, required, invalid or empty. In doing so, date and datetime feels are serialized and added to the evalContext, but serializing dates can be slow, especially when not using the default English locale. Internally, luxon checks whether the locale is English which instantiates an Intl object which can be slow and this is compounded by the fact that the method is called hundreds of time in a single render. This commit caches serialized dates and datetimes in a WeakMap, as the luxon Date objects are immutable, this is safe, and because these objects are not recreated often, it also eliminates a lot of the calls to luxon's toFormat. In the quotation list view, this brings the render time from ~1100ms to ~270ms. While this is still slow and further work will be undertaken to make the evalContext lazy (so that only date/datetimes which are actually used are serialized), it is a good first step and brings the performance back to a level where the list view is reasonably usable. closes odoo/odoo#110103 X-original-commit: 64eeeef4d3d93a9b2753520e0067aa7996988d4c Signed-off-by: Aaron Bohy (aab) <aab@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%