Reputation: 145
I wish to make a field readonly in Openerp 6.1 views.
I want the field to be readonly for all groups but specific groups, let's say manager should be able to edit it while others should be able to only view.
I am not clear how to do it in a view ? Please suggest. Thanks.
Upvotes: 2
Views: 5216
Reputation: 5044
You just create a functional field in your model which will be true if the user belong to manager group else false, then add attrs
for your field so that it will be editable if the user belong to manager group or else readonly.
or you can try this method:
'your_field_name': fields.char(
'Customer Reference',
size=64,
write=['base.group_partner_manager'],
read=['base.group_user'],
),
You can find this in https://answers.launchpad.net/openobject-server/+question/178779
Upvotes: 4
Reputation: 980
OpenERP provide a facility to apply a restriction to specific group by accessright. let's take simple example if you have two group user and manager for model project.project and you allow that user can only read project and manager can read,write,update,delete a project.create two group user and manager and give rights you want to give. now apply this group on your field in xml for eg.groups="project.group_project_user"
Upvotes: 0
Reputation: 2587
you need to share more information about wht model(module ) and what view are we talking about.
It its a base module then the only way might be to inherit it and then make changes.
You can try the below short cut but I am not sure if it will work out for you.
go to Settings >> Customization >> Database Structure >> Fields >>
There find the field and model you want to change and then in security change it.
Upvotes: 0