Odoo Help

Welcome!

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.

0

How to make the whole record readonly in openerp7

By
vivek
on 8/27/13, 3:16 AM 1,441 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.

0
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. 

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

0 follower(s)

Stats

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