Browse Source

publish muk_web_theme - 12.0

pull/48/head
MuK IT GmbH 5 years ago
parent
commit
a947962263
  1. 2
      muk_web_theme/__manifest__.py
  2. 18
      muk_web_theme/models/res_config_settings.py

2
muk_web_theme/__manifest__.py

@ -19,7 +19,7 @@
{
"name": "MuK Backend Theme",
"summary": "Odoo 12.0 community backend theme",
"version": "12.0.1.1.15",
"version": "12.0.1.1.16",
"category": "Themes/Backend",
"license": "AGPL-3",
"author": "MuK IT",

18
muk_web_theme/models/res_config_settings.py

@ -44,13 +44,19 @@ class ResConfigSettings(models.TransientModel):
@api.multi
def set_values(self):
res = super(ResConfigSettings, self).set_values()
variables = [
{'name': 'o-brand-odoo', 'value': self.theme_color_brand or "#243742"},
{'name': 'o-brand-primary', 'value': self.theme_color_primary or "#5D8DA8"},
]
self.env['muk_utils.scss_editor'].replace_values(
SCSS_URL, XML_ID, variables
colors = self.env['muk_utils.scss_editor'].get_values(
SCSS_URL, XML_ID, ['o-brand-odoo', 'o-brand-primary']
)
brand_changed = self.theme_color_brand != colors['o-brand-odoo']
primary_changed = self.theme_color_primary != colors['o-brand-primary']
if(brand_changed or primary_changed):
variables = [
{'name': 'o-brand-odoo', 'value': self.theme_color_brand or "#243742"},
{'name': 'o-brand-primary', 'value': self.theme_color_primary or "#5D8DA8"},
]
self.env['muk_utils.scss_editor'].replace_values(
SCSS_URL, XML_ID, variables
)
return res
@api.model

Loading…
Cancel
Save