Odoo Help

0

Can we create Security permission for each fields

By
supreeth
on 9/23/15, 1:34 AM 1,102 views

I have users called Admin and Users.   

I given all access rights for admin.

As i know we can give permissions for a table but not for particular fields.

Is it possible to give permissions/access rights for fields?

For Example: In table 'x' there are 2 fields called name and ph.num, we can create a group for table 'x' for Admin and give rights to edit name and ph.num. And i will create another group for same table 'x' for User that he can edit only ph.num. If i login as User he can change both name and ph.num, So my question is to edit only one ph.num field. How can we do this?

1

You can't set access rights for particular fields. It's not available by default in Odoo + it is not possible also. ( Unless in V6.1 there was a community module available but I am sure you are not using V6.1 ) 

However you can use attrs and group attributes for particular field to make it invisible/readonly in certain conditions. But It will surely not possible In Odoo that x user can edit some field and y user can't from front end view or configuration.

However from object/model level you can achieve that.

There are 2 attributes(read and write.) you can apply inside field definition.  ( it was available in V7, i am not sure on V8 )

 You can specify groups by comma separated in each attribute. write will allow you to edit but when you save field it will not let you save the latest data if user is not available in particular group which is specified in write attribute.

Also Check following links, it may help you.

1. https://www.odoo.com/forum/help-1/question/is-it-possible-to-manage-record-based-access-control-2597

2. https://www.odoo.com/forum/help-1/question/how-to-apply-field-level-access-rights-for-user-19481

Hope this helps,


 


@Emipro I'm not sure that I understood his question and your answer correctly.. Can't he create a group with the users in which has rights on the model and then specify that group for the specific field?

Yenthe
on 9/23/15, 2:11 AM

@yenthe yes we can do that, but it wont solve the issue what i am facing. for eg: in table 'x' there are 2 fields called name and ph.num, we can create a group for table 'x' for Admin and give rights to edit name and ph.num. And i will create another group for same table 'x' for User that he can edit only ph.num. If i login as User he can change both name and ph.num, So my question is to edit only one ph.num field. How can we do this?

supreeth
on 9/23/15, 2:30 AM

@yenthe you know what he is asking ? let me explain. Suppose there is one odoo instance in which 3 users are there. Yenthe, Emipro and Admin. Now @Supreeth's requirement is that when Emipro logged in they can't modify "city" field in partner screen whereas Yenthe user can do it when he logged in. That is not possible by your suggestion. Because if you assign group and define access rights then to whole record it will be applied but not for particular field. I hope you will understand now.

Emipro Technologies Pvt. Ltd.
on 9/23/15, 3:10 AM

@Emipro yes it is correct

supreeth
on 9/23/15, 6:17 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 9/23/15, 1:34 AM
Seen: 1102 times
Last updated: 9/23/15, 2:31 AM