Skip to Content
Menu
This question has been flagged
8 Replies
15961 Views

For example i the 'Customers' menu under Sales category.

i want to change the parent of customers to my custom module's menu item name

Details

*******

sale

 -->

    sales

      ->

             customers

             My piipeline

             etc

i want to change like this

MyMain Menu

-->

     MySubMenu

     ->

             Customers

Notes

I want to add customers under Mysubmenu . Please help me how to get the answer.Thanks in advance

Avatar
Discard
Author

thanks IT Libertas

Author

Thanks Mahmoud

Author

Thanks Ajmal

Best Answer

You can inherit the customer menu in your module and change it parent to your new submenue,

such as:

<menuitem name="Menu name"

            id="module.menu_id"

            parent="your_sub_menu" />

 

Example :

<menuitem name="Customers"

            id="base.menu_base_partner"

            parent="MySubMenu"

        />

Avatar
Discard
Best Answer

You can change any xml view by naming id to model_name.id:

here you need to change it as:

<menuitem id="sales_team.menu_partner_form" parent="your_parent_menu_id" action="base.action_partner_form" sequence="3"/>

You can also achieve the same if you create a new menu item and give the action base.action_partner_form and hide the current customers if needed.

Avatar
Discard
Best Answer

You may do on interface or code level:

If code, you should fully redefine the meny unit xml in your app. E.g. for a pipeline in crm,   

<menuitem   id="crm.menu_crm_opportunities" action="crm.action_your_pipeline" parent="NEW_PAPRENT" sequence="4"/>

If on interface: go to Settings > Technical > User Interface > Menu Items > Find required and change the field 'Parent Menu' to yours. Be cautious: if you update the original app (e.g. Crm for a pipeline), parent would be changed back. Thus, it is better to use script modifications.

Avatar
Discard
Best Answer

You can change any xml view by naming id to model_name.id:

here you need to change it as:

<menuitem id="sales_team.menu_partner_form" parent="your_parent_menu_id" action="base.action_partner_form" sequence="3"/>

You can also achieve the same if you create a new menu item and give the action base.action_partner_form and hide the current customers if needed.

Avatar
Discard
Best Answer

Actuallly the best way to do this is by replacing the parent of the original view by your new id.

Example: Open a folder --> create a file.xml, __manifest__.py, __ini__.py

In your file.xml add the following

<?xml version="1.0" encoding="UTF-8"?>

<odoo>

    <data>

        <!--<record id ="property_sales_menu" model ="ir.ui.view">  -->

            <menuitem id="property_sales_menu_root"                 action="sales_team.crm_team_salesteams_act" sequence="5" name="Property Sales"/>

              <menuitem id="property_sales_menu_sub" parent ="property_sales_menu_root" sequence="1" name="Property Sales"/>

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 19
7932
2
Mar 18
9062
2
Nov 24
25095
2
May 24
5519
3
Mar 24
4964