[FIX] website: perf - don't search backend menu if you will not see it
Before this commit, in all cases, we search the backend menu to open if you click on edit backend menu. But the backend menu edit is useless for non editor user. This feature has been introduce in v13, since eLearning have his own apps, so when you edit in backend, you want to see the slide form view, into the elearning app and no website App. Related to #47257 task-2211013 X-original-commit: 1da7e53f4cdd82574688eb62f7a1cb8ddca871e6
This commit is contained in:
committed by
Romain Derie
parent
1d981f22f3
commit
30f24d1ca7
@@ -384,8 +384,9 @@ class View(models.Model):
|
||||
elif request.env.user.has_group('website.group_website_publisher'):
|
||||
new_context = dict(self._context, inherit_branding_auto=True)
|
||||
if values and 'main_object' in values:
|
||||
func = getattr(values['main_object'], 'get_backend_menu_id', False)
|
||||
values['backend_menu_id'] = func and func() or self.env.ref('website.menu_website_configuration').id
|
||||
if request.env.user.has_group('website.group_website_publisher'):
|
||||
func = getattr(values['main_object'], 'get_backend_menu_id', False)
|
||||
values['backend_menu_id'] = func and func() or self.env.ref('website.menu_website_configuration').id
|
||||
|
||||
# Fallback incase main_object dont't inherit 'website.seo.metadata'
|
||||
if not hasattr(values['main_object'], 'get_website_meta'):
|
||||
|
||||
Reference in New Issue
Block a user