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 a field read-only on a on_change() event ? [Closed]

By
Sohail
on 5/3/13, 8:22 AM 2,313 views

The Question has been closed

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

0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

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.

Syntax:

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

Remya
on 5/3/13, 9:04 AM

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

Sohail
on 5/3/13, 9:10 AM

Hai Sudhir, Did you get my question?

Remya
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/3/13, 8:22 AM
Seen: 2313 times
Last updated: 3/16/15, 8:10 AM