コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1702 ビュー

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'.





アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 24
1473
2
9月 24
2474
1
1月 23
2454
0
11月 24
1344
0
9月 24
1609