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

I have a field that is defined as:-

request_text = fields.Html('Incident Description', required=True)

and in the xml:-

<field name="request_text" widget="html" />​

But somehow the field is not mandatory in the form.

How do I make sure that the field is made mandatory and it is highlighted as mandatory in the form and the form shows validation error when it is submitted without filling this field?

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

Hi,

For the latest version the required attribute will work for html fields. So either in python side or in the xml side, you can set the required=True for the field.


Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 19
10463
0
พ.ค. 22
3301
Odoo 13: Form view inherit แก้ไขแล้ว
4
มิ.ย. 21
7093
1
มิ.ย. 17
10882
3
มี.ค. 15
8708