Files
Benoit Socias 46c889b946 [FIX] website: update theme images also during updates
In order for preview images to be shown in the theme selection page, the
`update_theme_images` function needs to be called.
This was done in a `post_init_hook`, which is called e.g. when
installing `website`.
This was also done in a `website` override of
`ir.module.module.update_list()` which is called when updating a module
interactively.
Unfortunately, even though this override is defined, at the time
`update_list()` is called from `loading.py` when using `-u` in the
command line, the modules are not loaded yet, and therefore the override
is not applied.
Because of this, when a database was upgraded to versions that introduce
new themes or new screenshots for themes, `update_theme_images` was not
called during the upgrade, and the new images were missing in the
upgraded database.

This commit solves this by calling `update_theme_images` from a
`function` data record, so that it is run both on install and on update
of `website`.

Steps to reproduce:
- Install website and a theme in 14.0.
- Upgrade to 15.0.
- Access the theme selection page.

=> Images were missing for some themes.

task-2719425

X-original-commit: 8e73375e674ba0018ac4ea12a5b19bb4e6bcae31
Part-of: odoo/odoo#163118
2024-04-25 17:06:49 +00:00
..