Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
7 Trả lời
24809 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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"/>
Ảnh đại diện
Huỷ bỏ

this solved my problem

pls thumb it up then

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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"}'

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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.

Tác giả

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

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/

Tác giả

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

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

Tác giả

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?

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

Tác giả

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

Are you using a workflow? That refers to state.

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ