Odoo Help


Dropdowns for custom navigation menu items?

Lindsay Slazakowski
on 10/18/16, 1:22 PM 740 views

I'm creating custom navbar links like so:


<record id="aboutus_page_link" model="website.menu">  
<field name="name">About Us</field>
<field name="url">/page/about-us</field>
<field name="parent_id" ref="website.main_menu" />
<field name="sequence" type="int">10</field>



And am wondering if it's possible to create dropdowns within those links. Possibly creating a new record with some parent reference, or something?



| 5 3 5
الخبر, Saudi Arabia

Activities     :    Youtube



           iWesabe                                  ◉

           Axon Communications        ❍

           Cybrosys Technologies        ❍

On 10/19/16, 1:54 AM


It will help You 

Top menu(Drop down)

<record id="menu_parent" model="website.menu"> 
    <field name="name">Parent Menu</field>
    <field name="parent_id" ref="website.main_menu"/>
    <field name="sequence" type="int">50</field>

Child menu (Drop down content)

<record id="menu_child" model="website.menu">
    <field name="name">Child menu</field>
    <field name="url">/foo</field>
    <field name="parent_id" ref="menu_parent"/>
     <field name="sequence" type="int">10</field>

In Python File

from openerp import http, _ 
from openerp.http import request

class Bar(http.Controller):
    @http.route('/foo', type='http', website=True, auth="public")
    def page_certificate_verification(self, **kw):
        return request.render('Your_module.your_template')

In xml

<template id="your_template">
    <t t-call="website.layout">
        <div id="wrap">
            <div class="oe_structure"/>
             <div class="container">
                 <!--Your Contents-->
`            </div>

@shameem@aχon Thank you so much! This is EXACTLY what I was looking for. I knew it would be something easy like this!

Lindsay Slazakowski
on 10/19/16, 11:37 AM

@shameem@aχon Regarding your custom controller, when I `return request.render('theme_worldbuilders.aboutus.xml')` I still get a 404. I think I'm not doing this right. Also, my aboutus.xml is in views/innerpages/, how am I supposed to reference that?

Lindsay Slazakowski
on 10/20/16, 9:14 AM
Lindsay Slazakowski
On 10/20/16, 9:12 AM

Regarding your custom controller, when I ```return request.render('theme_worldbuilders.aboutus.xml')``` I still get a 404. I think I'm not doing this right. Also, my aboutus.xml is in views/innerpages/, how am I supposed to reference that?

You pass the file name instead of template id

You create a template in the file aboutus.xml


return request.render('Your_module.your_template_id')

on 10/20/16, 11:18 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/18/16, 1:22 PM
Seen: 740 times
Last updated: 10/20/16, 9:12 AM