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

Hi everyone,

I've created a new group to hide a menu-item, so I did this :

courier.xml :

        <menuitem
            id="courier_top_menu"
            name="Courier"
            action="courier_action"
            parent=""
            sequence="100"                    
        />
        <record model="ir.ui.menu" id="courier_top_menu">
            <field name="groups_id" eval="[(6,0,[ref('make_courier_invisible')])]"/>
        </record>        

courier_security.xml :


        <record id="make_courier_invisible" model="res.groups">
            <field name="name">Couriers Management</field>
        </record>


My issue is :

    I can assign/remove an admin user to this new group to show/hide the menu, but if I create a simple user and assign him to the group, the menu doesn't appear !


Please what's the mistake in my code ? Thanks.

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

HI BKF

If the security group works for the admin and not for the user it's because the user doesn't have permission over the menu action model and to solve it you could just assign the needed ir.model.access permissions to the security group in question so everyone that get the security group will get also permission over the model in question for that menu

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

Thank you so much :)))))) it works fine now :)))

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

Hello,

To assign a menu or view to a specific user you can use this:

        <menuitem
            id="courier_top_menu"
            name="Courier"
            action="courier_action"
            parent=""
            sequence="100"    
            groups= "make_courier_invisible"             
        />

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

Hi @Mohammed,

Thanks for answer, but I tried this without success ! as I said, it works fine with admin user, but for new simple user no chance !!!

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 23
24206
1
thg 1 17
7040
0
thg 12 16
4629
1
thg 7 15
4264
4
thg 5 24
46073