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

Is it possible to use eval for invisble attribute?

By
René Schuster
on 7/4/14, 4:16 AM 1,180 views

What I want to do:

Hide a page in a form view if its not the users own record, or the user is not in a given group.

What I've tried:

Using attrs to set the page invisble.

The Problem:

uid is not available in attrs.(?)

Question:

Can I use the eval expression to evaluate True or False for the invisible attribute directly, instead of using attrs?

What other suggestions?

Using groups would work to hide the page for groups, but this way, I can't make the page visible for the owner of the record. (?)

 

Thanks.

1

Vasiliy Birukov

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

Vasiliy Birukov
On 7/4/14, 9:50 AM

For your case you can define function filed, that will return your evaluation.

Make that field invisible.

With attrs control your PAGE through this field.

 

Thx for the reply. I've read about that solution before. I think it's ugly, but it will do if there are no alternatives.

René Schuster
on 7/7/14, 4:11 AM
1

Leonardo Donelli

--Leonardo Donelli--
1040
| 5 4 8
Cave, Italy
--Leonardo Donelli--

Physics student and part-time developer.

Leonardo Donelli
On 7/4/14, 10:36 AM

See this answer and this launchpad bug discussion. From what I understand it is not supported and you'll have to write a function field that returns the uid, and use that.

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: 7/4/14, 4:16 AM
Seen: 1180 times
Last updated: 3/16/15, 8:10 AM