Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
23649 มุมมอง

Hello,

I have created a custom module and created its root Menu Item. I don't want to give him access of any other module. Which I have achieved successfully but I am not able to hide Employee Root Menu Item from the top bar. If I try to uncheck or unselect the field it reverts my action on saving the record. How Can I hide the employee menu item for that specific group.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Dear Mian Kamran


Try This


    <record id="access_main_hr_menu" model="res.groups">
        <field name="name">Hr Main Menu</field>
    </record>


    <record model="ir.ui.menu" id="hr.menu_hr_root">
          <field name="groups_id" eval="[(6,0,[ref('access_main_hr_menu')])]"/>
    </record>



I hope I helped you..

อวตาร
ละทิ้ง

it's worked for me. vote 1+

คำตอบที่ดีที่สุด

Hello , 

First Create Group Using Below Code :

<record model="res.groups" id="group_user_hide" >
        <field name="name">Hide User</field>
</record>

If you want to Employ Menu for Specific Group Than Try Below Code For Example in Sale order:

<menuitem id="menu_sale_config"
            name="Configuration"
            parent="sale_menu_root"
            sequence="6"
            groups="Module.group_user_hide"/>

I Think It's Help You.


Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello 

Create one group and that group assign on the HR main manu

<record model="res.groups" id="group_hr_menu" >
        <field name="name">Group HR Menu</field>
</record>

now assign above group on the HR Root menu

<record id="hr.menu_hr_root" model="ir.ui.menu" >
<field name="groups_id" eval="[(6, 0, [ref('module_name.group_hr_menu')])]"/>
</record>




อวตาร
ละทิ้ง

Thank you @ Mitul Shingala

+1

Why this is not working at odoo 15 version?

คำตอบที่ดีที่สุด

Create a new group and add new group for employee menu as well as remove employee group from the menu

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 17
6152
0
มิ.ย. 25
2311
0
มี.ค. 19
5488
6
ธ.ค. 23
112410
1
ก.ค. 19
2596