76adca8ec960c324d53f8f4c9bf8dfe4e0f9297e
Since #121376 a clear_cache was removed when unlinking an attachment This clear_cache was not useful when restarting a server with new sources, an other operation changing the content of an assets should invalidate the cache manually. This is the case of ir.asset CUD operations. Unfortunately, a manual update was left missing in website, when archiving ir.assets used for snippets. This was discovered on runbot, with two workers, when the first workers generates assets before the cron, and the second one after the cron. The second worker unlinks attachments creating an inconsistency in the cache of the first one. This problem can be solved quickly by invalidating the assets cache in the cron manually but this will be done in all cases. The proposed solution will check the ir.asset that should change and only clear the cache if the state changed. Regarding performances, this should actually be a slight improvement in query count since at the cost of one more select to prefetch the record we can avoid multiple update, one per snippet. In most case no update at all should be done, at most 2 can be done (one for archive, one for unarchive). Example with some assets to unarchive: Before: TOTAL ENTRIES: 277 SELECT: 158 (~0.16591858863830566s) UNKWOW: 54 (~0.0202481746673584s) UPDATE: 65 (~0.03202557563781738s) After: TOTAL ENTRIES: 214 SELECT: 159 (~0.1663439826965332s) UNKWOW: 54 (~0.029229164123535156s) UPDATE: 1 (~0.0002865791320800781s) If the number of query is lowered, the python processing is slightly higher. Locally the test time is similar, slightly longer since an additional call to _disable_unused_snippets_assets was added to check the cache invalidation closes odoo/odoo#130973 X-original-commit: 3aeab51ff4379e6d76172614fd39f09d6c449ac6 Signed-off-by: Xavier Dollé (xdo) <xdo@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%