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

hi i have a tab named qualification on a form,,,in which i have 3 fields i do not want them to be empty means if they are empty they should not be saved,,,i have added the attribute "required = True",,,,but its not working,kindly can someone tell?

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

paresh wagh sir its not working,,

คำตอบที่ดีที่สุด

Hi,

Remove attrs

<field name="degree_title" placeholder="Degree Title" required='1'/>
Thanks

Aswini - iWesabe


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

Can you please share the code, how you declared it in python and xml?

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

Please share your code here for both file python and xml without your code we can't help you.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด


<page name="Parent’s Qualification" string="Qualification">
<field name="qual_ids">
<tree string="Qualification" name="Parent’s Qualification"
editable="top">
<field name="degree_title" placeholder="Degree Title" attrs="{'required': [(True)]}"/>
<field name="insit_name" placeholder="Institute Name" attrs="{'required': [(True)]}"/>
<field name="qual_year" placeholder="Qualification Year" attrs="{'required': [(True)]}"/>

degree_title = fields.Char(string="Degree Title", required=True)insit_name = fields.Char(string="Institute Name", required=True)qual_year = fields.Char(string="Qualification Year", required=True)​







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

this is the code in xml and python file

คำตอบที่ดีที่สุด

Remove the brackets around True and change 

attrs="{'required': [(True)]}"

to

attrs="{'required': True}"

อวตาร
ละทิ้ง