[FIX] odex25_web: check if website installed
This commit is contained in:
parent
efa75bba68
commit
4a8d68b92b
|
|
@ -2,3 +2,15 @@
|
||||||
|
|
||||||
|
|
||||||
from . import models
|
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': [
|
'data': [
|
||||||
'views/webclient_templates.xml',
|
'views/webclient_templates.xml',
|
||||||
'views/login_custom.xml',
|
'views/login_custom.xml',
|
||||||
'views/customize_menu_seurity.xml'
|
# 'views/customize_menu_seurity.xml'
|
||||||
],
|
],
|
||||||
'qweb': [
|
'qweb': [
|
||||||
"static/src/xml/*.xml",
|
"static/src/xml/*.xml",
|
||||||
],
|
],
|
||||||
|
'post_init_hook': 'post_init_setup'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue