Thursday, November 17, 2022
1 change · master
Resolved issues and error corrections
This fix ensures Odoo's automated tours and tests fail when real application code has missing dependencies, instead of silently passing. It also cleans up related issues in Live Chat, Website Live Chat, Web reports, and Website Slides so production problems are detected earlier and release quality improves.
Original PR description
*: im_livechat, website_livechat, website_slides In https://github.com/odoo/odoo/commit/c989ff339d1bb8afde3371d12dab8cc227941691, the odoo module system has been changed so that it now errors out…
*: im_livechat, website_livechat, website_slides In https://github.com/odoo/odoo/commit/c989ff339d1bb8afde3371d12dab8cc227941691, the odoo module system has been changed so that it now errors out when modules are defined but have missing dependencies and cannot run. Unfortunately, tours are defined in a single bundle, `assets_tests`, and this bundle is used everywhere tours need to run, but some of these tours depend on modules that only exist in the backend and others on modules that only exist in the frontend. We don't want to break up the `assets_tests` bundle as this creates a poor developer experience, and so the solution that was chosen at the time is that when the `assets_tests` bundle is defined, we ignore all module dependency errors. This causes a problem however, which is that if a module dependency is missing in production code, the page will be broken by the module error (which is expected) but if the `assets_tests` are present, which is the case when running tours and tests, then it won't, meaning the tours will happily pass despite the application being broken, which is unacceptable. This commit fixes this issue by replacing the assets_test bundle by a new bundle (`__assets_tests_call__`) within which all module dependency errors are ignored, which lets dependency errors that are hapenning in other bundles (ie in production code) happen even during the tests. Because of this, this commit also fixes the dependency errors that already existed but were previously silent: - for im_livechat and website_livechat, the code was refactored to use the standard mechanism that we use elsewhere to add data directly in the page: we store the data in __session_info__, and the module that exposes that data is always present, instead of having a module that's defined conditionally, which causes issues when non-conditional modules depend on it. - in web, the `report_assets_common` bundle was used alongside `assets_common` but without `assets_frontend` or `assets_backend`. Reports do not need any js and it appears that it already had what it needed as far as css is concerned except for one fontawesome override. Code was changed so that the js from the bundle is not included and it reports no longer use `assets_common`, the js part of the bundle is no longer used. - in website_slides, the `slide_embed_assets` bundle is used alongside `assets_common` without using `assets_frontend` or `assets_backend` which is required for `assets_common` to function, the approach here was to simply take the files from `assets_common` and remove the files that were causing issues. This bundle should be trimmed at some point, as it contains way too many things that it does not need. The file colors.js was also moved to core, as it isn't graph specific and was causing dependency issues with a field that was importing it.