Odoo Help


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.


Is it possible to make a VIEW readonly for a creatin user??? If that so how will i do that?

on 12/16/14, 10:36 PM 655 views

I want to make readonly the JOURNAL ENTRIES in Accounting Tab so that the user can't allow to edit or chage anything in JOURNAL ENTRIES..  Thanks in advance.

@alcaline for which model / screen - accounting tab you want to perform this operation. You can inherit the view and add the "readonly" attribute to that field. What is your actual goal behind making the field readonly, knowing that a better solution can be delivered.

Emipro Technologies Pvt. Ltd.
on 12/17/14, 12:30 AM


| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 12/17/14, 3:05 AM

Few possible solutions...
1. use security options, and restrict writing to model(s) shown on that view fro some users/groups 
-> this will not make form field read only, but will not allow selected user to write anything..(meaning.. he will be able to enter any changes, but if tries to save pop up will notify him that he has no right to write to that models) - this would be fastest and prefered way for me...

2. you can make a copy of view (with different external id, and sequence higher that 16) wich will have all fields readonly,
and modify the action wich opens the view to select wich view (RO/RW) to open according to current user...

3. you can modifiy a view, and put attribute readonly="check_ro()" on every field, where method check_ro return treu/false depending on current user... 

methods 2 and 3 demands more coding, but result in more transparent user expirience ( meaning fields will be actualy shown in ro/rw modes) while method 1 is quick solution, but a bit confusing to users (also providing result you want : fields not writeble)

hope it helps :) 

Based on my experience, you can make new copy of the view just like option 2. and assign the groups that will used that view. There is an attribute that you can use for the XML view to assign it to specific group: .

on 9/5/15, 6:42 AM

field name="groups" eval= "[(4, ref('group_cpg_emp_dir_self'))]"

on 9/5/15, 6:45 AM

"group_cpg_emp_dir_self" is the xml_id of your group. If it belongs to another module, you need to use the format "module_name.group_xml_id"

on 9/5/15, 6:46 AM

Ben Bernard

--Ben Bernard--
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 12/17/14, 3:08 AM

As far as I know, you can restrict access per model via Access Right (available in security configuration). So maybe you want to set a group read-only for some view in Accounting Tab and make that group have access right to the model as read-only. Then add the user to this group.

With this setting, all fields in the model will automagically appear read-only.

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)


Asked: 12/16/14, 10:36 PM
Seen: 655 times
Last updated: 3/16/15, 8:10 AM