Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1613 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
zář 24
1389
2
zář 24
2386
1
led 23
2385
0
lis 24
1283
0
zář 24
1559