Skip to content

Commit a1b29f3

Browse files
committed
[FIX] web_responsive: Fix blank screen on search (support menus w/o xmlid)
If a menu item is created manually via the Odoo UI, then it (likely) won't have an xmlid. As a result, the `t-foreach` fails, resulting in the whole Odoo UI crashing (a blank white screen is shown). This code should use `id` as the `t-key` instead, as that is *always* available, even for menu items created manually.
1 parent 9a011c9 commit a1b29f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_responsive/static/src/components/menu_canonical_searchbar/searchbar.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class="list-unstyled search-list"
2626
t-ref="searchItems"
2727
>
28-
<t t-foreach="state.rootItems" t-as="menu" t-key="menu.xmlid">
28+
<t t-foreach="state.rootItems" t-as="menu" t-key="menu.id">
2929
<li t-attf-class="search-item {{highlighted(menu_index)}}">
3030
<a
3131
t-attf-class="search-item__link"
@@ -59,7 +59,7 @@
5959
>
6060
<hr class="w-100" />
6161
</li>
62-
<t t-foreach="state.subItems" t-as="menu" t-key="menu.xmlid">
62+
<t t-foreach="state.subItems" t-as="menu" t-key="menu.id">
6363
<li t-attf-class="search-item {{highlighted(menu_index, true)}}">
6464
<a
6565
t-attf-class="search-item__link"

0 commit comments

Comments
 (0)