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

For example, I inherit the the model product.template and added a field servie_id and makes it required.
But the warning message in my log file
warning

Table 'product_template': unable to set a NOT NULL constraint on column 'service_id' !


Notes

I know one option is to select the table and add values to service id whether it is null.
is there any other option for avoiding this warning in log file?



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

Hi Muhammed,


You have made the servie_id field required through python file.

Removed the required attribute from python file and set that field required from XML file, by required=" 1"

E.g.

<field name="servie_id" required="1">

When you set the required property through python, it adding the constraint to database. because of that constraint the error message/warning message added in log file. by following approach you can resolve your issue.

Hope this will help.


Regards,

Anil Kesariya 

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Anil

You're welcome @Muhammed :)

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 4 20
2299
1
thg 8 24
12536
2
thg 11 17
14658
0
thg 9 17
3984
2
thg 2 19
6321