Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
1304 Weergaven

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

Avatar
Annuleer
Beste antwoord

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
Annuleer
Auteur

Thanks. Does this work on the odoo online version

Gerelateerde posts Antwoorden Weergaven Activiteit
0
okt. 24
1600
0
mei 24
3093
3
mrt. 15
9110
4
mei 25
2785
0
aug. 24
1004