Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1628 Widoki

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





Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 24
1392
2
wrz 24
2397
1
sty 23
2395
0
lis 24
1293
0
wrz 24
1561