Tuesday, 27 August 2013

How to make the whole record readonly in openerp7

How to make the whole record readonly in openerp7

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.

No comments:

Post a Comment