Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to change the name of an existing menuitem?

Subscribe

Get notified when there's activity on this post

This question has been flagged
7 Replies
55583 Views
Avatar
Juan Formoso Vasco

I'd like to change the label of a couple menu options. For example, I want to change the name of the main menu option Sales (crm). I know how to achieve this from the user interface, but it's better to do it through code.

I read in other posts that the only way to do this is declaring a new menuitem with the same ID of the menuitem you want to change. So, I want to change these ones (main menu option and submenu):

<menuitem name="Sales"
    id="menu_base_partner"
    groups="base.group_sale_salesman"
    sequence="20"/>
<menuitem id="base.menu_sales" parent="base.menu_base_partner" name="Sales" sequence="1" />

So I put this in my module code:

<menuitem name="My new string"
    id="menu_base_partner"
    groups="base.group_sale_salesman"
    sequence="20"/>
<menuitem id="base.menu_sales" parent="base.menu_base_partner" name="My new string" sequence="1" />

What is happening is that the top menu option "Sales" is turned into "My new string", which is correct. However, the submenu is not being changed and even more, the other submenus (which were in blue color) are being transformed in dropdown options.

If I remove the line <menuitem id="base.menu_sales" parent="base.menu_base_partner" name="My new string" sequence="1" />, the top menu option "Sales" is not being altered, and if I leave that line and add another menuitem whose parent is base.menu_sales, then both menu and submenu options are replaced well but the other submenus are being transformed in dropdown options.

Can anyone help me, please?

EDIT

I tried next code too, but nothing changed. I'm sure that the XML ID I'm using is right (I'm getting it from Configuration > User interface > Menu items)

<record model="ir.ui.menu" id="base.menu_base_partner">
     <field name="name">My New Menu Name</field>
</record>

1
Avatar
Discard
Jesús Ventosinos
Jesús Ventosinos

sorry for multiple answers, you need to change id="menu_base_partner" to id="base.menu_base_partner"

Baiju KS

please let me know if that worked...??

Juan Formoso Vasco
Author

@Jesus and @Baiju, with id="base.menu_base_partner", there are no errors but the menuitem name does not change.

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

For changing name of an existing menu item, you can do it like this,

<record model="ir.ui.menu" id="sales_team.menu_sale_config">
<field name="name">Configuration</field>
</record>

Refer:  How To Inherit Menu Item And Make Changes in Odoo

Thanks

3
Avatar
Discard
Zahtoot

those 2 methodes mentioned in the video are not working on odoo 18 any solutions

Avatar
Marvin Taboada
Best Answer

Hello Juan, menu entries are stored as records of the 'ir.ui.menu' object type, so it is possible to use 'record' XML tags to update 'ir.ui.menu' records by providing 'model' and 'id' attributes to identify the existing record. E.g. Project>Configuration (source here):

    <record model="ir.ui.menu" id="mod_id.menu_id">
      <field name="name">My New Menu Name</field>
    </record>

'record' XML tags are processed differently, so you only require to provide fields/values for anything you want to modify.

Regards,
Marvin

Edit: I created a simple module 'hr_menu_mv' to shorten the top level "Human Resources" menu to "HR", just to verify this approach, below are sources for the three files required (verified with v7.0 and v8.0):

__init__.py:

# empty as no python modules are required to be imported

__openerp__.py:

{
    'name': "HR Menu Mv",
    'version': "0.1",
    'category': "Human Resources",
    'depends': ['hr'],
    'data': ['hr_menu_mv_view.xml'],
    'installable': True,
    'auto_install': False,
    'application': False,
}

hr_menu_mv_view.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record model="ir.ui.menu" id="hr.menu_hr_root">
            <field name="name">HR</field>
        </record>
    </data>
</openerp>

I'm omitting translations just to keep the example small and readable.

4
Avatar
Discard
Juan Formoso Vasco
Author

This is the way I like the most, but nothing happened. I tried this: My New Menu Name --- I am sure that the XML ID of the menu I want to change is that one (base.menu_base_partner), because I am looking for it in Configuration > User interface > Menu items. I am writing that code from my customized module. Do you see anything wrong?

Juan Formoso Vasco
Author

I am sorry, I always forget that when I paste XML tags in a comment, these ones dissapear, so I am going to edit the question so you can check what I did.

Juan Formoso Vasco
Author

Thank you for your patience Marvin. I did exactly what you did: I created a new module with your lines (for v7) However, nothing happened again. In my case, the XML ID of the main menu option of Human Resources is "hr.menu_hr_main". I tried with both, but still nothing. I restarted and updated the service and then pressed F5. No results.

Marvin Taboada

Juan, I have verified that the "base.menu_base_partner" menu entry is defined four time in v7.0 sources, once in the "base" module, and then three times in the following modules: "crm", "crm_helpdesk", "sale". If you're using any of the previous modules, chances are that your entry (either 'record' or 'menuitem') that renames "base.menu_base_partner" is not applied last (so it gets renamed to Sales again). In order to guarantee that your changes are applied last, you can declare module dependencies to any other modules that rename "base.menu_base_partner" ("crm", "crm_helpdesk", "sale") so your module will be installed after all of them.

Juan Formoso Vasco
Author

One minute! I have just checked my database and the record name for that menu was changed well, as you said! But for one reason I can't see the changes in the browser.

Juan Formoso Vasco
Author

I'm racking my brains to know why I can't see the changes on the browser, I tried a lot of things, but still nothing. One thing is clear: the code you gave me is changing my database, and it's working for you, so your answer is right. I will open another question to ask about my other problem, but this one is solved. Thank you a lot for your patience, Marvin.

Juan Formoso Vasco
Author

I had to synchronize terms to see the changes: https://www.odoo.com/forum/help-1/question/why-cant-i-see-changes-made-on-the-table-ir-ui-menu-trying-to-change-a-menuitem-67732

iWesabe Technologies

+1

Avatar
Baiju KS
Best Answer

Try this:-

<menuitem name="New String"
    id="sale.menu_base_partner"
    groups="base.group_sale_salesman"
    sequence="20"/>

3
Avatar
Discard
Juan Formoso Vasco
Author

Thank you! But that does not work, I get the next error: AssertionError: The ID "sale.menu_base_partner" refers to an uninstalled module. In fact, the menu I want to change is "base.menu_base_partner" (I can see it trough the OpenERP interface).

Avatar
Jesús Ventosinos
Best Answer

if you want to override a id youn need to set the complete id module.id

0
Avatar
Discard
Avatar
Soporte Jocaagura
Best Answer

Do not forget insert into

<data noupdate="0">
<record model="ir.ui.menu" id="hr.menu_hr_root">
    <field name="name">HR</field>
<!-- in 11 version -->
    <field name="complete_name">HR</field>
</record>
</data>

to force the update of registry and CTRL+f5 in web browser to update the display name

0
Avatar
Discard
Avatar
Xabier Arrabal Amat
Best Answer

I had the same problem, after trying all the methods none worked. Finally I realized that there was a translation problem as the menuitem name term was already translated, therefor although the changes were made correctly they were not visible. Check out the tranlsation terms to check if your menu name is already there. The method I finally used was: 

<menuitem name="Sales"
id="account.menu_finance_receivables"
parent="account.menu_finance"
sequence="2"/>
0
Avatar
Discard
Avatar
Billiard R Made
Best Answer

Using an SQL Manager I would open ir_ui_menu and ir_ui_menu_group_rel and delete all records related to this particular Menu. Then ammend my template and update

Try code below. Paying attantion to my bold text. The two must be exact. If you put base.menu_base_partner on the first one then the bottom one must also be base.menu_base_partner

<menuitem name="My new string"
    id="menu_base_partner"
    groups="base.group_sale_salesman"
    sequence="20"/>
<menuitem id="base.menu_sales" parent="menu_base_partner" name=
"My new string" sequence="1" />

-1
Avatar
Discard
Atchuthan - Technical Consultant, Sodexis Inc

@Billiard, This is a wrong methodology. When you delete the record directly using SQL manager, the corresponding menus are removed. But when you update your database using -u all command, then you will have multiple menus (old+newly created menu)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now