Odoo Help


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 1,067 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.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


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