Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
1448 Visualizações

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

Avatar
Cancelar
Melhor resposta

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
Cancelar
Autor

Thanks. Does this work on the odoo online version

Publicações relacionadas Respostas Visualizações Atividade
0
out. 24
1720
0
mai. 24
3296
3
mar. 15
9300
4
mai. 25
2950
0
ago. 24
1156