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

Make a field readonly in edit mode and editable in create mode in openerp

By
supreeth
on 1/9/15, 5:19 AM 1,228 views

I want to make a field readonly in edit mode and editable in create mode in openerp. I want a field for which value is specified while creating and later it should not be changed.

This is my code:

<field name = "apply_to_future" class="oe_edit_only" attrs="{'readonly':[('status','=','Draft')]}" />

 

Thanks in advance

0
supreeth
On 1/9/15, 5:33 AM

Thanks Ivan,

We got, 

attrs="{'readonly':[('pay_value','!=',False)]}"

attrs="{'readonly':[('pay_value','!=',False)]}"

supreeth
on 1/9/15, 5:33 AM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/9/15, 5:27 AM

Have you tried including ID in the view and set the attrs="{'readonly':[('id','>',0)]}" ?

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

1 follower(s)

Stats

Asked: 1/9/15, 5:19 AM
Seen: 1228 times
Last updated: 3/16/15, 8:10 AM