Odoo Help


What is the Error in this Code

aci aisha
on 2/10/15, 8:00 AM 842 views

                  <field name="file_no" attrs="{'readonly':[('id','>', 0), '&' ,('file_no','!=',False)]}"/>


Your question forces people to open it to understand what you are asking. For this reason you are probably reducing your audience.

Ray Carnes
on 2/10/15, 4:01 PM



| 5 3 8
Pondicherry, India
On 2/10/15, 9:26 AM

Then 'id' should be a field:

In .py file:

'id': fields.integer('ID'),

In xml file:

<field name="id" invisible="1"/>

<field name="file_no" attrs="{'readonly':[('id','>', 0) ,('file_no','=',True)]}"/>

(note:no need of checking & )

I tried,No error,,Perfect.. But this condition ('file_no','=',True) is not working

aci aisha
on 2/10/15, 9:32 AM

Is the 'file_no' a many2one field? Is true means,it checks the conditions that id> 0 and the many2one field has some values.Give the values,Save the record and click edit to view the field is readonly or not?

on 2/10/15, 9:38 AM

Yes,I give values for file_no(many2one0 and save...but it s nt bcom read only!!!

aci aisha
on 2/10/15, 11:17 PM

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

1 follower(s)


Asked: 2/10/15, 8:00 AM
Seen: 842 times
Last updated: 3/16/15, 8:10 AM