Merge pull request #1688 from expsa/samir-aladawi-fix-errors
[FIX] odex25_web: check if website installed
This commit is contained in:
commit
9b8ceaae39
|
|
@ -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])]})
|
||||
|
|
@ -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'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue