Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1432 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор

Thanks. Does this work on the odoo online version

Related Posts Відповіді Переглядів Дія
0
жовт. 24
1711
0
трав. 24
3272
3
бер. 15
9274
4
трав. 25
2928
0
серп. 24
1151