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

Create a view for a specific user/group

By
Davide
on 7/7/14, 11:02 AM 1,512 views

How to create different "views" and associate them to different group of users?

What you wrote is working for me:

<field name="code" groups="base.group_multi_company"/> 

Only the user within the group "group_multi_company" can see that field!

Now my problem is to make it with a new group (settings->groups->new group).

I tried base.new_group hr.new_group and so one... but none of them is working. I will post a specific question just for that issue.

Thanks!

Davide
on 7/18/14, 9:04 AM
1

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 7/7/14, 11:19 AM

You generally don't achieve that with the views itself, but you can surely achieve this using the groups="" attribute on your view.

For example:
<field name="code" groups="base.group_multi_company"/> 

This would only show my "code" field to any user that has the "multi company" setting checked.

I create the group "test-group" within Settings->Groups and I add user1 as group member. Then I modify the code like this: Now the field is not visible for user1 or other users. Is it correct "base.test-group" or I should change "base" with something else: "xxxxxxx.test-group"?

Davide
on 7/18/14, 6:38 AM

The xxxx should be the name of the module that the group is defined in. Normally you would make a custom module for this. For example: If you module is called "sale_davide" and you make an XML with the group name "test-group", then the item should have groups="sale_davide.test-group". Hope this helps!

Ludo - Neobis
on 7/18/14, 6:59 AM

where is available the list with standard module names? what I need now is the human resource (leave management). Thanks for your answers.

Davide
on 7/18/14, 7:18 AM

Thanks, with standard group is working file. Here is my new question related to the additional topic: https://accounts.openerp.com/forum/help-1/question/hide-a-field-using-a-new-group-57792

Davide
on 7/18/14, 9:48 AM

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

2 follower(s)

Stats

Asked: 7/7/14, 11:02 AM
Seen: 1512 times
Last updated: 3/1/16, 11:00 PM