From 94e2eefca28196efc0ac38f155a3b85acbbdeaae Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 25 Jan 2023 14:52:28 +0000 Subject: [PATCH] [FIX] website: review "this page" sub-menus visibility for non-designers The page properties and optimize seo menu items were not explicitly marked as not shown for non-designers. An unrelated bug currently hides those items by chance... but as that bug will be solved in a further commit of this same PR, it had now to be explicitly hidden in that case. Note that after this a related bug remains: the "This page" title on top of those sub menus is left visible if no sub menu is shown and clicking on it actually crashes. That bug will be solved in another PR. Also note that it might make sense to show the optimize seo dialog for restricted editor users when they have the correct rights... but this would be an improvement to consider in master. Related to task-3129034 X-original-commit: 26c46ba70bac227c2b6a28a941e5c4f13bfe9029 Part-of: odoo/odoo#111289 --- addons/website/static/src/services/website_custom_menus.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/website/static/src/services/website_custom_menus.js b/addons/website/static/src/services/website_custom_menus.js index 207c263f8e6..6782360e81e 100644 --- a/addons/website/static/src/services/website_custom_menus.js +++ b/addons/website/static/src/services/website_custom_menus.js @@ -80,6 +80,7 @@ registry.category('website_custom_menus').add('website.menu_edit_menu', { registry.category('website_custom_menus').add('website.menu_optimize_seo', { Component: OptimizeSEODialog, isDisplayed: (env) => env.services.website.currentWebsite + && env.services.website.isDesigner && !!env.services.website.currentWebsite.metadata.mainObject, }); registry.category('website_custom_menus').add('website.menu_current_page', { @@ -95,6 +96,7 @@ registry.category('website_custom_menus').add('website.menu_ace_editor', { registry.category('website_custom_menus').add('website.menu_page_properties', { Component: PagePropertiesDialog, isDisplayed: (env) => env.services.website.currentWebsite + && env.services.website.isDesigner && !!env.services.website.currentWebsite.metadata.mainObject && env.services.website.currentWebsite.metadata.mainObject.model === 'website.page', getProps: (services) => ({