Odoo Help

0

How to Customize UserMenu on upper right corner

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

I want to add another menu

Documentation

Support

About

Preferences

New_menu


What should I do?

0
Shameem
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
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
on 8/27/16, 4:12 AM

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.

Register

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)

Stats

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