Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
6694 Vizualizări

I'm trying to insert some menu items in the Odoo's default web menu. I'm using the xpath tag to posicionate the changes that I want to apply in the HTML code but I'm not able to do it correctly. Here is the example: 

<template id="portal_menu_economic_data" inherit_id="portal.frontend_layout"> 

 <xpath expr="//ul[@class='nav navbar-nav navbar-right']" position="inside">

 <li> <a href="/my/economic_data"> <span data-oe-model="website.menu" data-oe-id="3" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name">Economic data</span> </a> </li> 

 </xpath> 

</template>

And this is how the menu looks like (each string is a menu page). 

Inicio | Contactenos | Administrator (dropdown) | Economic data

I need yo posicionate the element "Economic data" before that the Administrator dropdown, but I'm not able. Some one knows how to do it? It is any other way to create the menu items? 

It is possible to create menu items with the model (website.menu) from my python code??

Thanks for reading!!

Imagine profil
Abandonează
Autor Cel mai bun răspuns

This error appears when I'm trying to use your code. Why is not finding "website.menu" model? 

odoo.tools.convert.ParseError: "website.menu" while parsing /home/avanzosc/workspace/desarrollosv11/portal_partner_characterization_gaia/views/economic_data_portal_templates.xml:390, near
<record id="menu_blog" model="website.menu">
            <field name="name">Blog</field>
            <field name="url">/blog</field>
            <field name="parent_id" ref="website.main_menu"/>
            <field name="sequence" type="int">40</field>
        </record>
Thanks for your reply.


Imagine profil
Abandonează
Cel mai bun răspuns

you can create a website menu using XML file record data.
Ref: https://github.com/odoo/odoo/blob/13.0/addons/website_blog/data/website_blog_data.xml#L10.
there is a sequence field that defines the position of the menu relative to there menu.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 21
3902
0
sept. 24
1234
2
iul. 23
6264
1
iun. 23
4293
1
apr. 23
5026