[FIX] website_theme_install: use correct xml_id for theme/hidden category
Commit a00ea2755d restored correct
definition of external id for the theme/hidden category but forgot
to adapt its use everywhere.
This commit is contained in:
@@ -42,10 +42,16 @@ class IrModuleModule(models.Model):
|
||||
|
||||
@api.multi
|
||||
def button_choose_theme(self):
|
||||
theme_category_id = self.env.ref('base.module_category_theme').id
|
||||
theme_category = self.env.ref('base.module_category_theme', False)
|
||||
hidden_category = self.env.ref('base.module_category_hidden', False)
|
||||
theme_hidden_category = self.env.ref('base.module_category_theme_hidden', False)
|
||||
|
||||
theme_category_id = theme_category.id if theme_category else 0
|
||||
hidden_categories_ids = [hidden_category.id if hidden_category else 0, theme_hidden_category.id if theme_hidden_category else 0]
|
||||
|
||||
self.search([ # Uninstall the theme(s) which is (are) installed
|
||||
('state', '=', 'installed'),
|
||||
'|', ('category_id', 'not in', [self.env.ref('base.module_category_hidden').id, self.env.ref('website_theme_install.module_category_theme_hidden').id]), ('name', '=', 'theme_default'),
|
||||
'|', ('category_id', 'not in', hidden_categories_ids), ('name', '=', 'theme_default'),
|
||||
'|', ('category_id', '=', theme_category_id), ('category_id.parent_id', '=', theme_category_id)
|
||||
]).button_immediate_uninstall()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user