コンテンツへスキップ
メニュー
この質問にフラグが付けられました
8 返信
17563 ビュー

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

アバター
破棄
著作者

thanks IT Libertas

著作者

Thanks Mahmoud

著作者

Thanks Ajmal

最善の回答

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"

        />

アバター
破棄
最善の回答

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.

アバター
破棄
最善の回答

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.

アバター
破棄
最善の回答

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.

アバター
破棄
最善の回答

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"/>

アバター
破棄
関連投稿 返信 ビュー 活動
1
6月 19
9251
2
3月 18
10783
2
7月 25
4511
2
12月 24
7680
2
11月 24
28442