Odoo Help


Any Mistake in this Code

aci aisha
on 2/5/15, 1:36 AM 810 views

  <field name="file_type"  attrs="{'readonly':[('field_type','!=', False)]}" on_change="onchange_file_type(file_type)" />

it causes the error as follows,

Uncaught Error: Unknown field field_type in domain [["field_type","!=",false]]


[["field_type","!=",false]] or [["file_type","!=",false]] ??

Atul Arvind
on 2/5/15, 1:41 AM


aci aisha
on 2/5/15, 1:44 AM



| 5 3 8
Pondicherry, India
On 2/5/15, 2:12 AM

you can use this in the xml.view.

<field name="field_type"/>

<field name="file_type"  attrs="{'readonly':[('field_type','=True)]}" on_change="onchange_file_type(file_type)" />


Atul Arvind

--Atul Arvind--
| 3 3 5
vadodara, India
--Atul Arvind--


I am odoo Enthusiast/Developer from Vadodara, India. Working with odoo from v5 to v11 and other opensource technology since 5+ years. Having Strong Expertise in

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


Here is my StackOverflow profile.  you can also find me on LinkedIn.

Contact: atul.surficle@gmail.com.

Atul Arvind
On 2/5/15, 2:31 AM

I think there is no field named field_type. it should be file type. just change your attrs like

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

if you have field_type field on your model, then put it in the form view. you can make it invisible.


Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 2/5/15, 2:06 AM

[Note: Is there a field "field_type" defined in your object
If field is unavailable, then modify your 

<field name="file_type"  attrs="{'readonly':[('file_type','!=', False)]}" on_change="onchange_file_type(file_type)" />

field_type  needs to be defined in your FORM view.

when we try to use a field in the domain, it needs to be defined in its respective view.  Also, it works even if the field is hidden
<field name="field_type" invisible="1" />

It works .. but when i try to save the following error occured,Integrity Error:The operation cannot be completed, probably due to the following:- deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set [object with reference: file_type - file.type]

aci aisha
on 2/5/15, 2:21 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

1 follower(s)


Asked: 2/5/15, 1:36 AM
Seen: 810 times
Last updated: 3/16/15, 8:10 AM