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

I want to hide my events page to only people who are portal and internal users. how can i do this.

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

Hi,


The function shown below can be used to hide menus on websites:


    def _compute_visible(self):

        super()._compute_visible()

        self.env.registry.clear_cache('templates')

        for menu in self:

            visible = True

            if menu.name == 'Events':  # Assuming 'Events' is the name of your events page menu

                if self.env.user.has_group('base.group_portal') or not self.env.user.share:

                    visible = False

            menu.is_visible = visible


Hope it helps

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

Thanks. Does this work on the odoo online version

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
1712
0
thg 5 24
3280
3
thg 3 15
9277
4
thg 5 25
2929
0
thg 8 24
1152