Skip to Content
Menú
This question has been flagged
1415 Vistes

How to setup access rights for menu items in website.menu programmatically?


Adding menu item to website.menu with below code is successfully. It ads menu "My Lands":

<record id="menu_my_lands" model="website.menu">

<field name="name">My Lands</field>

<field name="url">/my_lands</field>

<field name="parent_id" ref="website.main_menu"/>

<field name="is_visible">True</field>

<field name="sequence" type="int">60</field>

</record>


How to make menu viewable only for logged in users? I need to this in xml or python code.


Adding <field name="groups_id" eval="[(5, 0, 0),(4, ref('base.group_user'))]"/> 

gives error ValueError: Invalid field 'groups_id' on model 'website.menu'.





Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de set. 24
1233
2
de set. 24
2121
1
de gen. 23
2241
0
de nov. 24
1130
0
de set. 24
1379