Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1451 Ansichten

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

Avatar
Verwerfen
Beste Antwort

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

Thanks. Does this work on the odoo online version

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Okt. 24
1721
0
Mai 24
3301
3
März 15
9304
4
Mai 25
2952
0
Aug. 24
1156