Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1488 มุมมอง

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
1776
0
พ.ค. 24
3356
3
มี.ค. 15
9393
4
พ.ค. 25
3040
0
ส.ค. 24
1209