odoo/odoo#163449

Created by fw-bot
label
odoo-dev:saas-17.2-15.0-update_theme_images-bso-_NIM-fw
head
1dc4a8e3d2e4589e4b776b5ffd1a30d0bdc49615
target
saas-17.2
merged
3 weeks ago by Website, Soukéina Bojabza (sobo)
forward-port of
odoo/odoo#160452

[FW][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` 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 defiend, at the time `update_list()` is called from `loading.py` when using `-u` on the command line, the modules are not loaded yet, and therefore the override is not applied.
Because of this, when a database was upgraded between 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

Forward-Port-Of: odoo/odoo#163118
Forward-Port-Of: odoo/odoo#160452