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

Hello everybody!!

Please, who knows what is the origin of this error because i didnt find anything in the python code.

Error: NameError: name 'field' is not defined

Thanks a lot in advance.

Best Regards.

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

Drees,
The cause of this error is that u must be having a typo somewhere with "fields" while defining the field under a class.

You can trace this by looking at your terminal, or if you dont have it, simply check your defined fields and see if you have any typo like that...

Hope it helps !

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

Hi,

Can you post all the message error and you python code ?

I have the same error like you when I write field without s:

Bad syntax
tax_line_ids = field.One2many('account.tax', 'tax_id', string='Tax Lines')
Correct syntax
tax_line_ids = fields.One2many('account.tax', 'tax_id', string='Tax Lines')

I got message error :

NameError: name 'field' is not defined

So check your code and find the error syntax.


Best regards,


 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 19
3212
0
thg 1 19
4119
4
thg 2 24
11359
0
thg 1 18
3305
0
thg 9 17
3685