跳至内容
菜单
此问题已终结
1 回复
1310 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
编写者

Thanks. Does this work on the odoo online version

相关帖文 回复 查看 活动
0
10月 24
1604
0
5月 24
3102
3
3月 15
9115
4
5月 25
2789
0
8月 24
1019