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

Hide field in configuration view Openerp 7

By
Victor
on 8/27/14, 7:31 AM 1,385 views

Hello, I'm trying to hide a field that appears in configuration view inside of access permission tab.

I created a new group because I have 2 admin users, the original of openerp is the suprem and the second one is a admin with less privileges than the original one, and I joined this group to the original admin user.

I created this new group through of platform, not using code (xml)

This new group makes appear a new field in the view, but I only want this field appears for the original admin, not in other users (neither the second admin)

I tried to create a new rule but it doesn't work... object: res.groups
Rules I've tried:
[('user_id','=',1)]
[('uid','=',1)]
[('login','=','admin')]

I tried to modify the view and make invisible this field and this works but if I do a "update all" of my database, it restores the original view and the field appears again...

Somebody knows what I could do?

Thank you so much in advance.

0

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 8/27/14, 3:38 PM

Create a view that inherits the original view and change the attribute of the field you are trying to hide using xpath

This way even if you update, this data wont be lost.

Hello, thank you for you answers. I tried the option of xpath but it didn't work because the part that I want to hide, it isn't static, it changes depends on groups that are created... And I cannot to inherit this view... (res.users.groups -> if you preview this view, you see an structure but if you go to code it is completly different...) Is there any way to hide this group of view by using rules or something like that? Thank you!

Victor
on 8/28/14, 8:08 AM

Hello, finally it worked! :D I found exactly the path I needed to put in xpath. Thank you very much!

Victor
on 8/29/14, 5:05 AM

You are welcome :-)

IBS
on 8/29/14, 7:07 AM
0

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/27/14, 10:32 PM

I tried to modify the view and make invisible this field and this works but if I do a "update all" of my database, it restores the original view and the field appears again...

Yes, this is expected result. One solution, the lazy version, is to update the xml file with the xml already in the database (the one you edited). Not the whole xml, but some content you already edited.

The recommended solution is, already mentioned by @IBS, to make new module to update the view.

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