diff options
| author | qsm-odoo <qsm@odoo.com> | 2016-01-13 11:41:00 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2016-01-13 15:10:02 +0100 |
| commit | dbd02552284d0e947f881a60254f2fc988a1f615 (patch) | |
| tree | 95f876a5d8176d18034bc7dd18de670af1f727fa /addons/website_theme_install/models/ir_module_module.py | |
| parent | bb56e484b767aa037ec697dd11b0bd865ec31db1 (diff) | |
[FIX] website_theme_install: language dependant code
The module did only work in english because the themes were found
amongst the applications thanks to their categorie names.
Solution is to search categories thanks to their xml_id :
base.module_category_theme or base.module_category_theme_...
and not
base.module_category_hidden or base.module_category_theme_hidden
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 |
