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.

1

Any Mistake in this Code

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

What??

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

Vasanth

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

5

Atul Arvind

--Atul Arvind--
1854
| 3 3 5
India
--Atul Arvind--

Hello, 

I am odoo Enthusiast/Consultant from Baroda, Gujarat, India. Working with odoo from v5 to v9 and other opensource technology since 4+ years. Having Strong Expertise in

Requirement gathering & Gap Analysis

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration

Implementation

I am also active on StackOverflow.

or 


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)]}"

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

1

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3883
| 5 3 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.

Generally,
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

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/5/15, 1:36 AM
Seen: 461 times
Last updated: 3/16/15, 8:10 AM