Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
8 Risposte
17562 Visualizzazioni

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
Abbandona
Autore

thanks IT Libertas

Autore

Thanks Mahmoud

Autore

Thanks Ajmal

Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 19
9251
2
mar 18
10783
2
lug 25
4511
2
dic 24
7680
2
nov 24
28442