Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1314 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

Thanks. Does this work on the odoo online version

Related Posts Odpovědi Zobrazení Aktivita
0
říj 24
1607
0
kvě 24
3112
3
bře 15
9124
4
kvě 25
2790
0
srp 24
1043