Files
ux-tools/hide_portal_module_by_user/hooks.py
2026-01-21 23:34:29 +01:00

17 lines
532 B
Python

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