Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1301 Tampilan

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

Avatar
Buang
Jawaban Terbai

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
Buang
Penulis

Thanks. Does this work on the odoo online version

Post Terkait Replies Tampilan Aktivitas
0
Okt 24
1597
0
Mei 24
3091
3
Mar 15
9109
4
Mei 25
2785
0
Agu 24
1004