İçereği Atla
Menü
Bu soru işaretlendi
8 Cevaplar
17589 Görünümler

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
Vazgeç
Üretici

thanks IT Libertas

Üretici

Thanks Mahmoud

Üretici

Thanks Ajmal

En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Haz 19
9266
2
Mar 18
10800
2
Tem 25
4560
2
Ara 24
7714
2
Kas 24
28456