Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1346 Представления

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
1625
0
мая 24
3165
3
мар. 15
9151
4
мая 25
2835
0
авг. 24
1071