[FIX] theme_*: enable footer/header template correctly

See [1], `enable_view()` is now in charge of disabling the already possibly
existing template header (and/or footer).
Disabling `website.template_header_default` was not enough, any of the other
template could have been selected by the user before updating the theme.

Note that when installing a theme the first time on a website, the error won't
occur as `_reset_default_config()` will be called through `_theme_remove()`.

[1]: https://github.com/odoo/odoo/pull/81181

Fixes https://github.com/odoo/upgrade/pull/3048
task-2593407
opw-2680866
opw-2685951
opw-2685124
opw-2679040

closes odoo/design-themes#536

Related: odoo/odoo#81181
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Romain Derie
2021-12-09 18:05:34 +00:00
parent b362a2ca38
commit 9a289ea574
28 changed files with 0 additions and 87 deletions
-3
View File
@@ -5,13 +5,10 @@ class ThemeNano(models.AbstractModel):
_inherit = 'theme.utils'
def _theme_nano_post_copy(self, mod):
self.disable_view('website.template_header_default')
self.enable_view('website.template_header_centered_logo')
self.enable_header_off_canvas()
self.enable_view('website.header_navbar_pills_style')
self.disable_view('website.footer_custom')
self.disable_view('website.template_footer_contact') # Old theme_treehouse dependency
self.enable_view('website.template_footer_descriptive')
self.enable_view('website.template_footer_slideout')
self.enable_view('website.option_footer_scrolltop')