Odoo Help


How to make the whole record readonly in openerp7

on 8/27/13, 3:16 AM 2,025 views

I know to make a field readonly with the "readonly" attribute. Is it possible to make the entire record readonly. That means that all field in a form should be readonly on a condition.

One insignificant way i found is to make this attrs="{'readonly':[('state','=','close')]}" in all the fileds present in the form.

<field name="responsible_id" class="oe_inline" attrs="{'readonly':
<field name="type" attrs="{ 'readonly':[('state','=','close')]}" class="oe_inline"/>
<field name="send_response" attrs="{'readonly':[('state','=','close')]}"/>[('state','=','close')]}"/>

However i don't think this be the right one. I expect some way to put readonly attribut common for the form. Kindly suggest.

In my example, People can view all the records and edit only their own records.

Thank You.

Pouya Maleki
On 5/21/15, 1:37 PM

Unfortunately you have to add attr to all fields, as far as I know, it is not possible to disable 'edit' button on the value of sate, because according to openerp framework, view xml is loaded before the data. 

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

0 follower(s)


Asked: 8/27/13, 3:16 AM
Seen: 2025 times
Last updated: 5/21/15, 1:37 PM