This question has been flagged
1 Reply
6461 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?

Avatar
Discard
Best Answer

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,


 


Avatar
Discard

@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?

Author

@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?

@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.

Author

@Emipro yes it is correct