Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to hide this menu item on the frontend for the public user?

By
Pascal Tremblay
on 6/6/16, 5:00 PM 368 views

Hello there,
I had to recreate the public user in one server.

How could I hide this menu item public user - AS when nobody is logged on the website?

Thanks to help. 

use record rule perhaps?

ahmad
on 6/6/16, 9:33 PM
1

Prakash Sharma

--Prakash Sharma--
815
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 6/7/16, 2:35 AM

you can try this module 

https://github.com/OCA/website/blob/9.0/website_menu_by_user_status


in short just check  request.uid == %(base.public_user)d



<t-if="request.uid == %(base.public_user)d)"> put you code here </t>

0

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 6/7/16, 1:46 PM

Our answer. hanks everybody.


<template id="layout_iv" inherit_id="website.layout" >

<xpath expr="//li[@class='dropdown']" position="replace">

<t t-if="request.uid != %(base.public_user)d">

<li class="divider" t-ignore="true" t-if="website.user_id != user_id"/>

<li class="dropdown" t-ignore="true" t-if="website.user_id != user_id">

<a href="#" class="dropdown-toggle" data-toggle="dropdown">

<b>

<span t-esc="user_id.name"/>

<span class="caret"></span>

</b>

</a>

<ul class="dropdown-menu js_usermenu" role="menu">

<li><a href="/web" role="menuitem">My Account</a></li>

<li class="divider"/>

<li><a t-attf-href="/web/session/logout?redirect=/" role="menuitem">Logout</a></li>

</ul>

</li>

</t>

</xpath>

</template>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/6/16, 5:00 PM
Seen: 368 times
Last updated: 6/7/16, 1:46 PM