summaryrefslogtreecommitdiff
path: root/addons/website_theme_install/models/theme_models.py
diff options
context:
space:
mode:
authorAndrea Ulliana <aul@odoo.com>2019-06-26 12:28:13 +0000
committerqsm-odoo <qsm@odoo.com>2019-07-30 09:59:28 +0000
commit7deceae18c209c67f6cfbbe3f7704798bb02a42e (patch)
tree625139a2d2a20e9cf4ee0768c92dc172bbde892b /addons/website_theme_install/models/theme_models.py
parent15bae2920cf6cf9e8f399ecc0374da04654ef66f (diff)
[IMP] website, *: use "auto" widget for font customization
* theme_bootswatch, theme_default, website_theme_install This commit makes use of the new 'auto' widget for font selection: instead of enabling a template which will enable a scss file which sets a font variable to a specific value... we directly allow to do a scss custo which sets that value. The code in charge of resetting font customizations on theme switching is also moved and refactored here in website (instead of being specific to each theme). Part of https://github.com/odoo/odoo/pull/33442 task-1974659 Co-authored-by: qsm-odoo <qsm@odoo.com>
Diffstat (limited to 'addons/website_theme_install/models/theme_models.py')
-rw-r--r--addons/website_theme_install/models/theme_models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/website_theme_install/models/theme_models.py b/addons/website_theme_install/models/theme_models.py
index 20a30c9713a..20105df25c1 100644
--- a/addons/website_theme_install/models/theme_models.py
+++ b/addons/website_theme_install/models/theme_models.py
@@ -147,6 +147,18 @@ class Theme(models.AbstractModel):
if not website: # remove optional website in master
website = self.env['website'].get_current_website()
+ # Reinitialize font customizations
+ self.env['web_editor.assets'].make_scss_customization(
+ '/website/static/src/scss/options/user_values.scss',
+ {
+ 'font-number': 'null',
+ 'headings-font-number': 'null',
+ 'navbar-font-number': 'null',
+ 'buttons-font-number': 'null',
+ }
+ )
+
+ # Call specific theme post copy
theme_post_copy = '_%s_post_copy' % mod.name
if hasattr(self, theme_post_copy):
_logger.info('Executing method %s' % theme_post_copy)