[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#1029
X-original-commit: c5f4e1c414
Related: odoo/odoo#190526
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',
|
template: 'test_themes.WebsiteSwitcherSystray',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-name="test_themes.WebsiteSwitcherSystray" t-inherit="website.WebsiteSwitcherSystray" t-inherit-mode="extension">
|
<t t-name="test_themes.WebsiteSwitcherSystray" t-inherit="website.WebsiteSwitcherSystray" t-inherit-mode="extension">
|
||||||
<xpath expr="//DropdownItem" position="attributes">
|
|
||||||
<attribute name="attrs">this.tooltips[element.id]</attribute>
|
|
||||||
</xpath>
|
|
||||||
<!-- With this module installed, disable the warning -->
|
<!-- With this module installed, disable the warning -->
|
||||||
<xpath expr="//DropdownItem/t[@t-if='!element.domain']" position="replace">
|
<xpath expr="//DropdownItem/t[@t-if='!element.domain']" position="replace">
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user