diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-01-27 12:24:04 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-01-27 12:24:04 +0100 |
| commit | 78d20b552b4374b94aec7097c0e6a48a3dd2d961 (patch) | |
| tree | 5acd7cbf1cc9e2f277034f44fc0ebebaa3a1a79c /addons/website_theme_install/models/ir_module_module.py | |
| parent | 740a6eadd379cc3fa26aefb9350f1c95b3e05ebd (diff) | |
| parent | 7e44ddcda3f21c7e6401173539dc0fe93f9a7dd2 (diff) | |
[MERGE] forward port of branch saas-8 up to 7e44ddc
Diffstat (limited to 'addons/website_theme_install/models/ir_module_module.py')
| -rw-r--r-- | addons/website_theme_install/models/ir_module_module.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/website_theme_install/models/ir_module_module.py b/addons/website_theme_install/models/ir_module_module.py index 93c62acee0f..09258d3385e 100644 --- a/addons/website_theme_install/models/ir_module_module.py +++ b/addons/website_theme_install/models/ir_module_module.py @@ -37,10 +37,11 @@ class IrModuleModule(models.Model): @api.multi def button_choose_theme(self, context): + theme_category_id = self.env.ref('base.module_category_theme').id self.search([ # Uninstall the theme(s) which is (are) installed ('state', '=', 'installed'), - '|', ('category_id', '!=', 'Hidden'), ('name', '=', 'theme_default'), - '|', ('category_id', '=', 'Theme'), ('category_id.parent_id', '=', 'Theme') + '|', ('category_id', 'not in', [self.env.ref('base.module_category_hidden').id, self.env.ref('base.module_category_theme_hidden').id]), ('name', '=', 'theme_default'), + '|', ('category_id', '=', theme_category_id), ('category_id.parent_id', '=', theme_category_id) ]).button_immediate_uninstall(context=context) next_action = self.button_immediate_install(context=context) # Then install the new chosen one |
