Skip to content
Snippets Groups Projects
Commit 0b480f6b authored by qsm-odoo's avatar qsm-odoo
Browse files

[FIX] website_theme_install, *: multi-website customization dialog

* theme_bootswatch, theme_default

Before this commit, the customization dialog for themes was not
multi-website. That means if a theme was installed on a website, the
customization dialog was enabled for all the websites.

Note: this commit uses the '_post_copy' system of theme installations
for the first time and it had to be adapted a little bit.
parent f39b3193
No related branches found
No related tags found
No related merge requests found
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
......@@ -9,8 +9,4 @@
<field name="action_id" ref="action_website"/>
<field name="state">open</field>
</record>
<record id="website_theme_install.customize_modal" model="ir.ui.view">
<field name="active" eval="False"/>
</record>
</odoo>
\ No newline at end of file
</odoo>
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import theme_bootswatch
from odoo import models
class ThemeBootswatch(models.AbstractModel):
_inherit = 'theme.utils'
def _theme_bootswatch_post_copy(self, mod):
self.env.ref('website_theme_install.customize_modal').write({'active': False});
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
......@@ -9,8 +9,4 @@
<field name="action_id" ref="action_website"/>
<field name="state">open</field>
</record>
<record id="website_theme_install.customize_modal" model="ir.ui.view">
<field name="active" eval="False"/>
</record>
</odoo>
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import theme_default
from odoo import models
class ThemeDefault(models.AbstractModel):
_inherit = 'theme.utils'
def _theme_default_post_copy(self, mod):
self.env.ref('website_theme_install.customize_modal').write({'active': False});
......@@ -63,11 +63,12 @@ class Theme(models.AbstractModel):
_auto = False
def _post_copy(self, mod):
website = self.env['website'].get_current_website()
theme_post_copy = '_%s_post_copy' % mod.name
if hasattr(self, theme_post_copy):
_logger.info('Executing method %s' % theme_post_copy)
method = getattr(self, theme_post_copy)
return method()
method = getattr(self.with_context(website_id=website.id), theme_post_copy)
return method(mod)
class IrUiView(models.Model):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment