Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3699 Lượt xem

Hi,

I created a custom module in that I have create a new group. and what I want to do is I want to hide the quotation menu, and only the user belong to new group could see the quotation menu.

<record id="group_sale_show_quotation_menu" model="res.groups">
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="name"> Show Quotation Menu</field>
</record>

and I want to show quotation menu only to this group of user. for that I code.

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

above is not working. user who is not belong to mentioned group still able to see quotation menu. am I missing something. Could anyone help me to achieve this.

Thanks in advance! 

Ảnh đại diện
Huỷ bỏ

Hi,

did you add security for this group for the model

Tác giả

No, I didn't add any security for the group.

Câu trả lời hay nhất

Hi,

The issue is that you are adding new groups to the menu from the code, it will work fine. But the issue is that already existing groups for the menu will remain in the database, so first of all you have to remove the existing groups from the menu and add the new group.

Either you can do it from the user interface of from the code.

<record id="sale.menu_sale_quotations" model="ir.ui.menu">
<field name="groups_id" eval="[(5, 0, 0)]"/>
</record>

If from the code, you can add the above code before adding new new group to the menu, so that existing groups will get removed from the menu. 

Also you can try by combining both operations in a single step(removing and adding)

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you Niyas

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 15
3577
2
thg 11 19
4920
2
thg 1 16
5239
1
thg 11 21
6842
7
thg 10 21
11614