Skip to content

Commit c3af5d9

Browse files
[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 #1011 Related: odoo/odoo#187391 Signed-off-by: William Braeckman (wbr) <[email protected]>
1 parent 0884033 commit c3af5d9

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

test_themes/static/src/systray_items/website_switcher.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,18 @@ patch(WebsiteSwitcherSystray.prototype, 'test_themes_website_switcher_systray',
2727
}
2828
});
2929
},
30+
31+
getElements() {
32+
// Add tooltip information
33+
const elements = this._super();
34+
return elements.map((elem) => {
35+
elem.dataset = {
36+
...elem.dataset,
37+
...this.tooltips[elem.id]
38+
};
39+
return elem
40+
});
41+
},
42+
3043
template: 'test_themes.WebsiteSwitcherSystray',
3144
});

test_themes/static/src/systray_items/website_switcher.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
</t>
66

77
<t t-name="test_themes.WebsiteSwitcherSystray" t-inherit="website.WebsiteSwitcherSystray" t-inherit-mode="extension">
8-
<xpath expr="//DropdownItem" position="attributes">
9-
<attribute name="dataset">this.tooltips[element.id]</attribute>
10-
</xpath>
118
<!-- With this module installed, disable the warning -->
129
<xpath expr="//DropdownItem/t[@t-if='!element.domain']" position="replace">
1310
</xpath>

0 commit comments

Comments
 (0)