Odoo Help


How to make a field read-only on a on_change() event ? [Closed]

on 5/3/13, 8:22 AM 2,956 views

The Question has been closed

Sudhir Arya (SA)
on 11/09/2013 02:34:55

I am working on a case where a field needs to be made readonly on on_change() event in openERP 7.0.

Sudhir Arya (SA)
On 5/3/13, 8:39 AM

It is not possible with onchange because from onchange you can only return value, domain and warning.

You can achieve your requirement on other way by using attrs.


<field name="your_field" attrs="{'readonly': [('field_name', 'operator', 'value')]}"/>

For example I want to make my field readonly when other field's value is service:

<field name="your_field" attrs="{'readonly': [('field_name', '=', 'service')]}"/>

Hi sudhir, how to configure a customer portal,who can see the product list and make sale order only.

on 5/3/13, 9:04 AM

Hello Sudhir Arya it worked great .. Thank you very much..

on 5/3/13, 9:10 AM

Hai Sudhir, Did you get my question?

on 5/3/13, 9:27 AM

it is not working for mr still have the same problem the value not saving ?!

Ahmed elbarbary
on 4/8/15, 8:54 AM

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: 5/3/13, 8:22 AM
Seen: 2956 times
Last updated: 3/16/15, 8:10 AM