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

i want to make 'Contacts' menuitem visible only to 'hr.group_hr_manager

<menuitem name="Contacts"
id="contacts.menu_contacts"
sequence="4"
web_icon="contacts,static/description/icon.png"
groups="base.group_user,base.group_partner_manager"/>

so i changed to:
groups="hr.group_hr_manager"
but still doesn't work
Thanks


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

HI,

If you do like this(the above code), the existing groups assigned to the menu wont get removed, instead the newly given group also will get added with the existing groups assigned to the menu.

If you activate the developer mode and navigate to Settings -> Technical -> User Interface -> Menu items, open your menu and check groups tab, now you can see there will be old group and newly added group. 

So what you have to do is that first of all you have to remove the existing groups from the menu and then assign the new group, for that you can do it like this.

<record id="contacts.menu_contacts" model="ir.ui.menu">
<field name="groups_id" eval="[(5,0),(4, ref('hr.group_hr_manager'))]"/>
</record>


Thanks

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

it works fine

thank you so much MR Niyas

Bài viết liên quan Trả lời Lượt xem Hoạt động
6
thg 12 22
15390
0
thg 2 20
2915
2
thg 12 19
5623
0
thg 1 25
1302
1
thg 3 25
652