[MOV]hide_portal_module_by_user: from elabore-addons to ux-tools
This commit is contained in:
17
hide_portal_module_by_user/hooks.py
Normal file
17
hide_portal_module_by_user/hooks.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from odoo import api, SUPERUSER_ID
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
"""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.
|
||||
"""
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
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
|
||||
Reference in New Issue
Block a user