Monday, October 7, 2019
2 changes · master
Enhancements to existing features
The demo data now gives the Customizable Desk and Conference Chair available inventory from the start. This prevents stock warning messages when these demo products are added to sales orders through the product configurator, making demonstrations smoother.
Original PR description
Targets commit d3530eb07e24278117ab396ecb86a59deecc312d Purpose ======= - The "Customizable Desk" and "Conference chair" products now have some stock in the initial inventory to avoid the stock warning when adding these products in a SO through the product configurator. 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
Creating many records that post the same automatic chatter message is now faster. The system reuses recent sanitized message content instead of recalculating it repeatedly, reducing processing time while keeping memory use low.
Original PR description
When records inheriting `mail.thread` are created, there is a tracking message that is posted on the chatter of each record, such as "partner created". This message is the same for every record (it just depends on the model name) however due to how `_create` is built the fields of type HTML will call `html_sanitize` for every value, even if they are the same. Since `html_sanitize` is rather costly in CPU, this commit caches its value with a low cache size, so that successive calls with the same parameters will be computed only once, all while keeping a fast lookup and low memory usage. As an example, when creating 1000 partners the time spent in `html_sanitize` was around 10% of the total creation time before the commit, and it is reduced to insignificance after the commit (less than 0.1%).