summaryrefslogtreecommitdiff
path: root/addons/website_theme_install/models/ir_module_module.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-01-27 12:23:09 +0100
committerChristophe Simonis <chs@odoo.com>2016-01-27 12:23:09 +0100
commit7e44ddcda3f21c7e6401173539dc0fe93f9a7dd2 (patch)
tree322d7f2ce86ce328c27197c5c1b31c9f4a2b2c5c /addons/website_theme_install/models/ir_module_module.py
parent3c7b08c030daf84323279b3d87361214e4f1b729 (diff)
parent6f923cbdcdc9a78d1999999b3bbd917eb8b4e921 (diff)
[MERGE] forward port of branch saas-7 up to 6f923cb
Diffstat (limited to 'addons/website_theme_install/models/ir_module_module.py')
-rw-r--r--addons/website_theme_install/models/ir_module_module.py5
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