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

readonly access to specific fields

By
Tomas Parnarauskas
on 5/29/13, 10:53 AM 1,605 views

Is it possible to set read only access at fields level? For example in project.task object, I want users to be able to be able to edit some parts of it, but other parts not. Like for example they can see tags in task, but can't change it. Although they can change stage of task.

So if I make project.task object read only, then users won't be able to change anything. I didn't see option to add groups in specific fields, only to those fields objects (models).

Is it possible somehow to do this?

2

Andreas Maertens

--Andreas Maertens--
912
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 5/29/13, 11:22 AM

If you want to set readonly to fields there are some ways:

In the client:

  1. activate debug mode
  2. open "manage views" from the new Dropdown on top
  3. choose active view and push "Edit" on bottom
  4. find your field and edit it
  5. activate "readonly"

In the view (when writing addons):

<field name="FIELDNAME" readonly="1">

or maybe not static:

<field name="FIELDNAME" attrs={(any condition)}

view: https://accounts.openerp.com/forum/Help-1/question/13042

In the model:

_columns={
    'fieldname': fields.[any](string="", readonly=True)
}

But doing this it will make readonly for every user I suppose. I only want to make it readonly for users that belongs in particular group.

NOD Baltic, UAB, Tomas Parnarauskas
on 5/30/13, 3:44 AM

So take a look to the link. There is a possibility to make it readonly / invisible for specific groups / conditions. If you don't get it, come back to me and I'll give you an example here again.

Andreas Maertens
on 5/30/13, 3:57 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

0 follower(s)

Stats

Asked: 5/29/13, 10:53 AM
Seen: 1605 times
Last updated: 3/16/15, 8:10 AM