Odoo Help


Any Mistake in this Code

aci aisha
on 2/5/15, 1:36 AM 684 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
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
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.


[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: 684 times
Last updated: 3/16/15, 8:10 AM