This question has been flagged

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.

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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!

Author

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

You are welcome :-)

Best Answer

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.

Avatar
Discard