Odoo Help


Custom Module error: field state unknown in domain [["state","in",["done"] ]]

on 4/9/13, 4:40 PM 11,254 views

when I click on my button "new" of my custom module I ve this error, have you idea : Error: field state unknow in the domain [["state","in",["done"]]]

On 7/15/13, 3:25 PM

It is because a field depends of the field state, but in the view there is not that field so just add

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

this solved my problem

mesay amare
on 9/3/13, 6:45 AM

pls thumb it up then

on 9/3/13, 11:42 AM
On 6/7/13, 11:02 PM

In the view, do have 'state' field???

Yes. I've actually done this two ways, by having <field name="state"/> and also using <field name="state" widget="statusbar"/>

Shaun Dawson
on 6/12/13, 4:44 PM
On 8/27/14, 5:04 AM

verify if you display the state field

<field name="state" widget="statusbar" statusbar_visible="draft,sent,progress,done"  statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'

Ray Carnes
On 4/9/13, 10:41 PM

There is a domain on one of the fields on your form that is using the STATE field, but this field is not available on the form.

Shaun Dawson
On 6/7/13, 9:32 PM

I had this exact same problem, and I think I fixed it by giving "state" a default value:

_defaults = {
    'state': 'new'

I'm not positive that's what fixed it because I was tracking a number of issues at the time, but my theory is that OpenERP didn't actually add the field into the domain until it actually needed it.

Grover Menacho
On 7/15/13, 5:12 PM

I think that you have a field on your code or your view calling state. Maybe invisible or readonly.

On 4/10/13, 12:40 PM

I have no state field in my form. OEP version that I use is 7.0-20130403-231707, it may be a bug.

Best to post your reply as a COMMENT, not an ANSWER. Either you need to remove the domain or add the field. If you post your XML it may be easier to spot the problem.

Bista Solutions US, Ray Carnes
on 4/10/13, 1:28 PM

Excuse. My XML > 600 charaters . How send it ? karma < 30.

on 4/10/13, 3:18 PM

Have it hosted and post the link - you can insert a space if you can't post links yet. http://collegefallout.com/10-good-free-file-hosting-websites-with-no-sign-up/

Bista Solutions US, Ray Carnes
on 4/10/13, 3:50 PM

here my xml http://www.yourfilelink.com/get.php?fid=835642

on 4/10/13, 4:44 PM

It doesn't help me spot the problem. Sorry.

Bista Solutions US, Ray Carnes
on 4/10/13, 9:22 PM

I do not understand me, I do not see any fields in the xml state. The parser can be confused fields state_id with fields state? is it possible?

on 4/11/13, 12:10 PM

No. The parser won't get confused. Something is referring to state and you need to find out what.

Bista Solutions US, Ray Carnes
on 4/11/13, 12:23 PM

I don't understand, this the sccreenshots errors : http://www.yourfilelink.com/get.php?fid=835725

on 4/12/13, 8:56 AM

Are you using a workflow? That refers to state.

Shaun Dawson
on 6/7/13, 9:14 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

2 follower(s)


Asked: 4/9/13, 4:40 PM
Seen: 11254 times
Last updated: 7/19/17, 4:42 PM