Odoo Help


How to add a new action menu item?

sanaa tayb
on 5/15/13, 11:14 AM 22,385 views

hello everyone , i'm trying to add a new menuitem on my created module , and have no idea how to do so ... Can anyone give me any hints or any exemples ...

my module is working fine , in the menu on the left side i want to add a new link if i may say so .. pleaase help me

wanna add directly into system or from code , plz describe

ClueLogics Technologies Pvt. Ltd.
on 5/15/13, 11:18 AM

i want to add it using code .

sanaa tayb
on 5/15/13, 11:24 AM

I would like to add a button directly from system - how can I do that? I cannot find these sections when editing FormView, thank you!

Tilfried Weissenberger
on 8/13/15, 5:45 AM

Anas Taji

--Anas Taji--
| 6 7 8
Amman, Jordan
--Anas Taji--

Skype: anas.taji-sw

Email: anas.taji@smartway-jo.com

Anas Taji
On 5/15/13, 12:17 PM

In your view definition xml file your_module_view.xml add the following code (you may want to change some parameters into yours):

<?xml version="1.0" encoding="UTF-8"?>
<!-- Your List View Definition -->
<record id="view_your_model_name_tree" model="ir.ui.view">
    <field name="name">Your.Module.Name_tree</field>
    <field name="model">your.object</field>
    <field name="arch" type="xml">
        <tree string="ANY NAME">
            <!-- Add All Fields You Want In The List Here -->
            <field name="db_field_name"/>

<!-- Your Form View Definition -->
<record id="view_your_model_name_form" model="ir.ui.view">
    <field name="name">Your.Module.Name_form</field>
    <field name="model">your.object</field>
    <field name="arch" type="xml">
        <form string="Form View Name" version="7.0">
            <!-- Add All Fields You Want In The Form Here -->
            <field name="db_field_name"/>

<!-- Your Action Window Definition -->
<record id="action_123" model="ir.actions.act_window">
    <field name="name">Your Module Name</field>
    <field name="res_model">your.object</field>
    <field name="view_type">form</field>
    <field name="view_mode">list,form</field>

<!-- Action Menu Item Related To Above Action Window -->
name="Readable Text" 

You may also want to take a look at idea module under your addons directory..%

it did work now i have a menu in the lest with 2 links one to list the list of my records( informations about my patient ) and second one to create a new record ( a new patient) ... Now my problem is i added a third menuitem ( so i can add an apointement for my patients ) but it didnt work .

sanaa tayb
on 5/15/13, 12:55 PM

i created a new file RDV .py , and added in my old Xml file ( the one i used in my module ) another List View Definition and Form View Definition , Action Window Definition and Action Menu Item Related To the new Action Window ... is it the right thing to do or should i create a new XML file ?? and if i shoold create a new one how to relate it to the old one ?

sanaa tayb
on 5/15/13, 1:01 PM

I am not sure if i got what you are asking for, You have one 'action menu item' that opens a list of patients (list view), and a form that shows patient per page (form view).

and you want to have another 'action menu item' to specify an appointment for a patient, am i right?

Smart Way Business Solutions, Anas Taji
on 5/15/13, 1:36 PM

Yes that's the idea .

sanaa tayb
on 5/15/13, 4:43 PM

ok, ask it in another question instead of extending the current one..%

Smart Way Business Solutions, Anas Taji
on 5/15/13, 5:55 PM

Ok i did it :), thank you for all your answers

sanaa tayb
on 5/15/13, 6:29 PM
On 9/7/17, 9:26 AM

The openERP  structure is __open__.py,__init__.py and module_name.xml.

__open__.py file contains the subsequent file data we have

__init__.py file contains the subsequent py files imports

module_name.xml having all menu items, so you should open this file and add your menu item which ever place you want

        <menuitem name="Employee" id="employee_menu_root"  />
        <menuitem name="Employee profile" id="employee_profile" parent="employee_menu_root" />
        <menuitem name="profile" id="candidate_profile" parent="employee_profile"" />


Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 5/15/13, 11:30 AM

Hi sey

Look below example :

<menuitem name="Example" action="define_your_menu_action" id="define_your_id" parent="parent_menu_id"/>

In menuitem name tag give your menu name and in action tag define your view action and in id tag define menu_id and parent tag give parent menu id means give id in which model menu you want to display your new menu.

Thank You

thank you very muuuch :)

sanaa tayb
on 5/15/13, 12:42 PM
On 5/15/13, 11:27 AM
<menuitem id="my_menu_id" name="My Menu"
        parent="parent_menu_id" sequence="1"/>

thank you very much it did work , now to add an action to this new menuitem , i create a new form, new tree and stuff like the first one ??

sanaa tayb
on 5/15/13, 11:51 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.


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

2 follower(s)


Asked: 5/15/13, 11:14 AM
Seen: 22385 times
Last updated: 9/7/17, 9:26 AM