[FIX] website_theme_install: fix the enable_view method

The method failed to enable views which were created by copying a
theme.ir.ui.view. This is because standard views were found with the
'ref' method while those particular ones were found thanks to the
copy_ids field... which only found the already active ones by default.
This commit is contained in:
qsm-odoo
2018-09-19 10:24:35 +02:00
parent 3ecf2fbc7e
commit fa12ae4009
@@ -75,6 +75,7 @@ class Theme(models.AbstractModel):
obj = self.env.ref(xml_id)
if obj._name == 'theme.ir.ui.view':
website = self.env['website'].get_current_website()
obj = obj.with_context(active_test=False)
obj = obj.copy_ids.filtered(lambda x: x.website_id == website)
obj.write({'active': active})