[FIX] odex25_web: check if website installed

This commit is contained in:
Samir Ladoui 2024-11-04 14:40:44 +01:00
parent efa75bba68
commit 4a8d68b92b
2 changed files with 14 additions and 1 deletions

View File

@ -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])]})

View File

@ -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'
}