Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1312 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thanks. Does this work on the odoo online version

Powiązane posty Odpowiedzi Widoki Czynność
0
paź 24
1606
0
maj 24
3107
3
mar 15
9119
4
maj 25
2789
0
sie 24
1029