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.

1

show a field only for logged in user ?

By
shriram sampat
on 9/11/15, 8:47 AM 806 views

Hallo Everyone,

I want to show some information in the employee form view (overtime, remaining leaves and so on..). But I dont want every employee seeing these information for every other. I want to show these information only for the current logged in user, when he see his details in form view. Others will see only his public information in form view.

Is there a possiblity to show a field / smart-button only for current logged in user ?

Thanks for any pointers.

Ram

0
shriram sampat
On 9/11/15, 10:33 AM

Hallo both,

thanks for the tip.

if I use attrs="{'invisible': [('user_id', '!=', uid)]}" with a field in form view, I am getting an error while saving the view. "uid not found". If i enclose uid in 'uid', then it accepts without an error, but the field is not even displayed for logged in user.

0

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 9/11/15, 10:07 AM

Shriram,

In employee master you have a user field, you can use this to hide your field, as when the employees concerned user logs in, this field will be hidden.

for this you can use attrs="{'invisible': [('user_id', '!=', uid)]}", this will hide that field if current employee is not of logged user

Hope it will help u

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 9/11/15, 9:29 AM

Shriram,

You must try attrs!

Make the fields visible only when the user_id=uid!

Employee has the 'Related User' field!

For attrs, you may check here.

Thanks.



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: 9/11/15, 8:47 AM
Seen: 806 times
Last updated: 3/29/16, 9:07 AM