Skip to Content
Menu
This question has been flagged
2 Replies
4431 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.

Avatar
Discard
Best Answer

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. 

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 24
13848
0
Nov 21
1457
7
Jul 18
19402
0
Dec 24
3
0
Dec 24
3