New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][FIX] website: update theme images also during updates #163449
Closed
fw-bot
wants to merge
2
commits into
odoo:saas-17.2
from
odoo-dev:saas-17.2-15.0-update_theme_images-bso-_NIM-fw
Closed
[FW][FIX] website: update theme images also during updates #163449
fw-bot
wants to merge
2
commits into
odoo:saas-17.2
from
odoo-dev:saas-17.2-15.0-update_theme_images-bso-_NIM-fw
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 46c889b
The image displayed in the theme selection page is the last one that was created out of the theme's manifest's `images` entry. Because of this, when a theme has a different non-last image in a new version compared to an old version, that image becomes the last created one and is displayed in the theme selection page instead of the expected screenshot image. This commit preserves the order that was specified in the `images` definition by re-creating all images instead of only the modified ones - if an update is needed at all. Steps to reproduce: - Install `website` with a theme in 14.0. - Upgrade to 15.0. - Go to the theme selection page. => Some themes (e.g. `theme_beauty`) displayed their cover picture instead of their screenshot. task-2719425 X-original-commit: 8a3315a
This PR targets saas-17.2 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
This was referenced Apr 25, 2024
robodoo
pushed a commit
that referenced
this pull request
Apr 26, 2024
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: 46c889b Part-of: #163449
robodoo
pushed a commit
that referenced
this pull request
Apr 26, 2024
The image displayed in the theme selection page is the last one that was created out of the theme's manifest's `images` entry. Because of this, when a theme has a different non-last image in a new version compared to an old version, that image becomes the last created one and is displayed in the theme selection page instead of the expected screenshot image. This commit preserves the order that was specified in the `images` definition by re-creating all images instead of only the modified ones - if an update is needed at all. Steps to reproduce: - Install `website` with a theme in 14.0. - Upgrade to 15.0. - Go to the theme selection page. => Some themes (e.g. `theme_beauty`) displayed their cover picture instead of their screenshot. task-2719425 closes #163449 X-original-commit: 8a3315a Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 installingwebsite
.This was also done in a
website
override ofir.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 fromloading.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 afunction
data record, so that it is run both on install and on update ofwebsite
.Steps to reproduce:
=> Images were missing for some themes.
task-2719425
Forward-Port-Of: #163118
Forward-Port-Of: #160452