[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#1025

X-original-commit: c3af5d9796
Related: odoo/odoo#190366
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
William Braeckman
2024-11-15 12:59:01 +00:00
parent 44226d822a
commit 1eb2e1cc38
2 changed files with 13 additions and 3 deletions
@@ -26,5 +26,18 @@ patch(WebsiteSwitcherSystray.prototype, {
}
});
},
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',
});
@@ -5,9 +5,6 @@
</t>
<t t-name="test_themes.WebsiteSwitcherSystray" t-inherit="website.WebsiteSwitcherSystray" t-inherit-mode="extension">
<xpath expr="//DropdownItem" position="attributes">
<attribute name="dataset">this.tooltips[element.id]</attribute>
</xpath>
<!-- With this module installed, disable the warning -->
<xpath expr="//DropdownItem/t[@t-if='!element.domain']" position="replace">
</xpath>