mirror of
https://github.com/odoo/design-themes.git
synced 2025-10-07 01:18:52 +07:00
[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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user