From c3af5d9796929025c9503ab639afc8c60a262b3f Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Fri, 15 Nov 2024 13:59:01 +0100 Subject: [PATCH] [FIX] test_themes: allow proper patch website_swit ..cher Defines dataset directly on website elements such that it can be overridden by other modules if necessary. This was done due to the override in the `test_themes` module completely overriding all attributes of the website_switcher's dropdown items. Runbot Error 106501 closes odoo/design-themes#1011 Related: odoo/odoo#187391 Signed-off-by: William Braeckman (wbr) --- .../static/src/systray_items/website_switcher.js | 13 +++++++++++++ .../static/src/systray_items/website_switcher.xml | 3 --- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test_themes/static/src/systray_items/website_switcher.js b/test_themes/static/src/systray_items/website_switcher.js index 594eaa780..9274cb1e1 100644 --- a/test_themes/static/src/systray_items/website_switcher.js +++ b/test_themes/static/src/systray_items/website_switcher.js @@ -27,5 +27,18 @@ patch(WebsiteSwitcherSystray.prototype, 'test_themes_website_switcher_systray', } }); }, + + getElements() { + // Add tooltip information + const elements = this._super(); + return elements.map((elem) => { + elem.dataset = { + ...elem.dataset, + ...this.tooltips[elem.id] + }; + return elem + }); + }, + template: 'test_themes.WebsiteSwitcherSystray', }); diff --git a/test_themes/static/src/systray_items/website_switcher.xml b/test_themes/static/src/systray_items/website_switcher.xml index a115af7cd..27e4d10d6 100644 --- a/test_themes/static/src/systray_items/website_switcher.xml +++ b/test_themes/static/src/systray_items/website_switcher.xml @@ -5,9 +5,6 @@ - - this.tooltips[element.id] -