Before this commit, some code was resetting some default website config
on theme change.
Problem 1:
This was not done when *removing* a theme. Thus when you wanted to go
back to a default website theme, you were not properly reset to the
default theme config. This could actually crash: some themes define
more fonts than others; so if you selected font 13 in one theme then
removed the theme, the default one would crash if not properly reset
as font 13 would not exist.
Problem 2:
It was done for every theme dependency, making theme change slower for
no reason.
Problem 3 (theorically, not tested):
The current code worked by chance as it called the website
'make_scss_customization' method without giving any website to it. It
actually worked by fallback on the right website in normal user cases
(user in the context of installing a theme on a specific website) but
may not be working when trying to install a theme on a different website
calling those functions from custom code.
Now, a dedicated method is there for config reset and is called at the
correct place with the right website in the context.
closesodoo/odoo#53743
X-original-commit: 7307d696449ea2b7a231b0b9087e64f6bbf65d26
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This reverts commit fdd4a143f2148ec5f4aeea80fecd3138fea95dc6.
See discussion in #51969closesodoo/odoo#52028
X-original-commit: 0e602cc0ac295621864b50509f78bd5de1e61718
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Before this commit, url preview of a theme was theme_xx/static/yyy.png
Now we make this url absolue /theme_xx/static/yyy.png
It was the expected behavior, and since werkeug 15.0 utils.redirect() don't use
'/' anymore as root but the current path.
Without this fix, theme selector uses /web/image/<id>, and the location become
/web/image/theme_xx/static/yyy.png instead of /theme_xx/static/yyy.png
closesodoo/odoo#51018
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
During theme install, theme.ir.ui.view are copied as ir.ui.view for the
requested website.
During theme update, those already created ir.ui.view will receive the
theme.ir.ui.view modifications, including the `arch`, even if it was changed by
the user, meaning the user changes would be lost.
Here are some examples which will be wiped away when the theme
is updated (only if the view is loaded from the theme module):
- Changes made from website HTML/CSS/JS editor.
- Changes made from website builder e.g. Theme modify footer with XPath
and user make changes in footer then user changes will be gone on theme update
- Changes made directly in the arch of ir.ui.view in the backend.
This commit fixes that behavior by not updating views which were modified by
the user.
closesodoo/odoo#49224
X-original-commit: 9906e1d403c4e9137a0313c342a455f425e95b8e
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Kishan Gajjar <kishanegajjar@gmail.com>
Themes image would not be shown correctly in the theme selection if the
`website` module was installed in CLI.
Indeed, the code supposed to load the theme images was done in the kanban view
during theme selection after installing module through apps screen.
Now, this code is encapsulated and called in post_init hook of website.
This was also needed for an improvement on `test_themes` module, see
https://github.com/odoo/design-themes/pull/195.
closesodoo/odoo#42206
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the website was given as a parameter of the
_post_copy function which is called after theme install. It was then
transfered through the context when calling the theme sub' post_copy
function.
It makes actually more sense to directly call the _post_copy function
with the right website in the context instead of a parameter. This will
also allow to call enable_view/disable_view in the default post_copy
common to all theme, with the right website.
closesodoo/odoo#41312
Signed-off-by: Romain Derie (rde) <rde@odoo.com>