[MIG] hide_portal_module_by_use: migrate to 18.0

This commit is contained in:
Stéphan Sainléger
2026-01-21 23:34:29 +01:00
parent 89711fed41
commit 84284e6c68
19 changed files with 657 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from odoo import api, SUPERUSER_ID
def post_init_hook(env):
"""Loaded after installing the module.
This module's DB modifications will be available.
:param odoo.sql_db.Cursor cr:
Database cursor.
:param odoo.modules.registry.RegistryManager registry:
Database registry, using v7 api.
"""
portal_views = env['ir.ui.view'].search([('inherit_id.xml_id', '=', 'portal.portal_my_home')])
if portal_views:
for p in portal_views:
p.create_group_from_view()
return True