diff --git a/odex25_base/odex25_web/__init__.py b/odex25_base/odex25_web/__init__.py index 9994f1bce..0a7c319cc 100644 --- a/odex25_base/odex25_web/__init__.py +++ b/odex25_base/odex25_web/__init__.py @@ -2,3 +2,15 @@ from . import models +from odoo import api, SUPERUSER_ID + + +def post_init_setup(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + # Check if the "website" module is installed + if env['ir.module.module'].search([('name', '=', 'website'), ('state', '=', 'installed')]): + # Update the menu item with the specific group access + menu = env.ref('website.menu_website_configuration', raise_if_not_found=False) + if menu: + group_website_publisher = env.ref('website.group_website_publisher') + menu.sudo().write({'groups_id': [(6, 0, [group_website_publisher.id])]}) \ No newline at end of file diff --git a/odex25_base/odex25_web/__manifest__.py b/odex25_base/odex25_web/__manifest__.py index 6daa4979c..77b228390 100644 --- a/odex25_base/odex25_web/__manifest__.py +++ b/odex25_base/odex25_web/__manifest__.py @@ -19,9 +19,10 @@ This module modifies the web addon to provide Odex design and responsiveness. 'data': [ 'views/webclient_templates.xml', 'views/login_custom.xml', - 'views/customize_menu_seurity.xml' + # 'views/customize_menu_seurity.xml' ], 'qweb': [ "static/src/xml/*.xml", ], + 'post_init_hook': 'post_init_setup' }