[FIX] theme_test_custo: Update menu search to match URL changes

Issue:
With PR [1], the url field for menus has been made required, with a
default value of #. This allows parent menus and megamenus to have a
URL.
However, in the theme_test_custo module, theme menus were previously
defined with parent menus having specific URLs. Due to this change, the
default url value is now #, making it impossible to search menus by URL.
As a result, the theme_menu_hierarchies tour failed.

Fix:
- Updated the menu search mechanism to align with the new behavior.
- Ensured that the tour passes successfully with the modified search
logic.

[1]: https://github.com/odoo/odoo/pull/160950

closes odoo/design-themes#1042

Task: 3851453
Related: odoo/odoo#160950
Related: odoo/upgrade#5904
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
This commit is contained in:
Mohammed Shekha
2025-01-16 10:35:26 +05:30
parent e564c44dfc
commit 15d381a90f
2 changed files with 2 additions and 2 deletions
-1
View File
@@ -62,7 +62,6 @@
<record id="main_menu_animals" model="theme.website.menu">
<field name="name">Main Menu Animals</field>
<field name="use_main_menu_as_parent" eval="False"/>
<field name="url">/main-menu-animals</field>
</record>
<record id="menu_dogs" model="theme.website.menu">
<field name="name">Dogs</field>
+2 -1
View File
@@ -24,7 +24,8 @@
<div class="col-lg-6 pt24 pb24 text-center">
<h5 class="mb-4">Useful Links</h5>
<ul class="list-unstyled">
<li t-foreach="request.env['website.menu'].search([('url', '=', '/main-menu-animals'), ('website_id', '=', request.website.id)]).child_id" t-as="menu">
<t t-set="animal_menu" t-value="request.env.ref('theme_test_custo.main_menu_animals')"/>
<li t-foreach="request.env['website.menu'].search([('theme_template_id', '=', animal_menu.id), ('website_id', '=', request.website.id)]).child_id" t-as="menu">
<a t-att-href="menu.url" t-esc="menu.name"/>
</li>
</ul>