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

Permission for a group to edit a single field only?

By
Shelton
on 3/28/13, 2:50 AM 8,316 views

Can we give permission for a group for editing only a single field in that model? None of the other fields shouldn't be edited..

3

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 3/28/13, 4:08 AM

Hi Shelton,

You can give permission for a group for editing only single field of model by defining :

<field name="Field_Name" groups="Group_Name">

Like that your group user can edit only Field_Name field which have access right.

Thank You, (SerpentCS Pvt. Ltd.)

This not practical. groups attribute completely blocks access to field (both read and write) for other groups. The poster want to allow certain groups to view all fields but only edit one field.

Mohammad Alhashash
on 3/28/13, 5:08 AM
1

Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
Tiny ERP Pvt Ltd
http://www.odoo.com
853
| 2 1 4
Ahmedabad, India
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 3/28/13, 3:33 AM

You can try

'field1': fields.float(string='Field',write=['base.GROUP_ID']),

Only user belongs to GROUP_ID can change that field..

Regards, Mustufa Rangwala

Are sure write is a field attribute!!! I could not find any reference to this attribute in source code.

Mohammad Alhashash
on 3/28/13, 5:03 AM

Hi Mohammad, Yes I am sure it is working with OpenERP 6.1 tested. The feature is like user who is not having that group can see that field but can not edit. If he/she try to edit OpenERP will remove that edit (does not save in to database..) ..

Mustufa Rangwala (mra)
on 3/28/13, 7:22 AM

No, There is no specific document related to this...

Mustufa Rangwala (mra)
on 3/28/13, 9:54 AM

Hello Mustufa, write only Permissions its working fine. Is there any way to show message to the End user for example other user try to modify field its shows "Sorry, you are not allowed to change this Field Data" Thanks

Prakash
on 10/14/13, 5:18 AM
0
Cristian Salamea
On 8/28/15, 1:21 AM

Check field access in http://odoo-80.readthedocs.org/en/latest/reference/security.html

You can use groups attr in field.

0
omar
On 7/22/14, 11:36 AM

Even if it was working, it would affect the view only, not an actual security measure. Do you have any reference to this option in documentation or source?

0

Mohammad Alhashash

--Mohammad Alhashash--
2075
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash
On 3/28/13, 5:22 AM

As I understand, you want to allow writing only to one field. Check this answer for information on how to control field access.

I think your best option is to use fields.property type for that field and create a record rule to control the access to the property and access rule to block writing to the main record.

Another option is to override create() and write() methods to check the group and access fields upon writing.

Check this answer for general information about access control.

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: 3/28/13, 2:50 AM
Seen: 8316 times
Last updated: 11/16/15, 7:23 AM