Skip to Content
Menú
This question has been flagged
1 Respondre
1380 Vistes

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

Avatar
Descartar
Best Answer

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

Avatar
Descartar
Autor

Thanks. Does this work on the odoo online version

Related Posts Respostes Vistes Activitat
0
d’oct. 24
1652
0
de maig 24
3187
3
de març 15
9164
4
de maig 25
2865
0
d’ag. 24
1100