Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5655 มุมมอง

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?



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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 

อวตาร
ละทิ้ง
ผู้เขียน

Thanks Anil

You're welcome @Muhammed :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 20
2271
1
ส.ค. 24
12488
How to raise warning on Odoo website? แก้ไขแล้ว
2
พ.ย. 17
14614
0
ก.ย. 17
3960
2
ก.พ. 19
6293