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>
sorry for multiple answers, you need to change id="menu_base_partner" to id="base.menu_base_partner"
please let me know if that worked...??
@Jesus and @Baiju, with id="base.menu_base_partner", there are no errors but the menuitem name does not change.