Odoo Help

Welcome!

This community 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.

0

How to Customize UserMenu on upper right corner

By
Giezel Esteves
on 8/26/16, 10:36 PM 212 views

I want to add another menu

Documentation

Support

About

Preferences

New_menu


What should I do?

0
shameem@aχoncoms
On 8/27/16, 12:42 AM

Hi Giezel , do it in odoo9

Step 1: Create an xml file for qweb

Your_Module/static/xml/q_template.xml

Step 2: Add in __openerp__.py

'qweb': ['static/xml/q_template.xml'],

Step 3:  Open q_template.xml and write

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="UserMenu">
  <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <img class="oe_topbar_avatar" t-att-data-default-src="_s + '/web/static/src/img/user_menu_avatar.png'"/>
        <span class="oe_topbar_name"/>
        <b class="caret"></b>
    </a>
    <ul class="dropdown-menu">
        <li><a href="#" data-menu="documentation">Documentation</a></li>
        <li><a href="#" data-menu="support">Support</a></li>
        <li><a href="#" data-menu="about">About</a></li>
        <li class="divider"/>
        <li><a href="#" data-menu="settings">Preferences</a></li>
<li><a>New_Menu</a></li>
        <li><a href="#" data-menu="account">My Odoo.com account</a></li>
        <li><a href="#" data-menu="logout">Log out</a></li>
    </ul>
  </li>
</t>
</templates>

 

How to call form in menu?

Giezel Esteves
on 8/27/16, 2:57 AM

Try it

xml:

<li id="new_menu_id"><a>New_Menu</a></li>

js:

Example

$(document).ready(function(parent,action){

$('#new_menu_id').click(function(){

var action_manager = new ActionManager(action)

action_manager.do_action({

name: _t('Some thing'),

type: 'ir.actions.act_window',

res_model: 'res.users',

view_mode: 'form',

view_type: 'form',

views: [[false, 'form']],

target: 'new',

context: {

}});

});

});

shameem@aχoncoms
on 8/27/16, 4:11 AM

add following before $(document).ready(function(parent,action)

var ActionManager = require('web.ActionManager');

var core = require('web.core');

var _t = core._t;

shameem@aχoncoms
on 8/27/16, 4:12 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/26/16, 10:36 PM
Seen: 212 times
Last updated: 8/27/16, 12:42 AM