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.

-2

What is the Error in this Code

By
aci aisha
on 2/10/15, 8:00 AM 476 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.

Bista Solutions US, Ray Carnes
on 2/10/15, 4:01 PM
0

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
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?

Vasanth
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

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: 2/10/15, 8:00 AM
Seen: 476 times
Last updated: 3/16/15, 8:10 AM