From 2874b241f40caf7c38a6dca68937cdcb7ccd242b Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Wed, 30 Nov 2022 09:20:54 +0000 Subject: [PATCH] [IMP] website: ease the header and footer visibility management This commit doesn't introduce any functional change but allows to manage header and footer visibility with the already existing data-invisible system. This simplifies the code and avoids doing an RPC at the start of the `VisibilityPageOptionUpdate` option. Related to opw-2971181 closes odoo/odoo#107387 X-original-commit: 07fdbc8847d254498b908a1cde0d910a77666f25 Related: odoo/upgrade#4120 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/editor/snippets.options.js | 8 -------- addons/website/views/website_templates.xml | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 9fe53adf80f..db56d33be45 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -2255,14 +2255,6 @@ const VisibilityPageOptionUpdate = options.Class.extend({ showOptionWidgetName: undefined, shownValue: '', - /** - * @override - */ - async start() { - await this._super(...arguments); - const shown = await this._isShown(); - this.trigger_up('snippet_option_visibility_update', {show: shown}); - }, /** * @override */ diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 759f705bf1c..b795172b8de 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -206,9 +206,11 @@ + '1' if 'header_visible' in main_object and not main_object.header_visible else None + '1' if 'footer_visible' in main_object and not main_object.footer_visible else None