Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1453 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Autore

Thanks. Does this work on the odoo online version

Post correlati Risposte Visualizzazioni Attività
0
ott 24
1724
0
mag 24
3302
3
mar 15
9314
4
mag 25
2955
0
ago 24
1159