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

I have been searching to find a solution to this but couldn't find the solution for it.
When you go to Contacts -> create a new contact, firstly you can choose a selection for "Individual" or "Company".
Depending on wich option you choose the "VAT" field should required when you choose "Company", but when you choose "Individual" it is not required.

In the template file located Settings -> User Interface -> Views -> res.partner.vat.inherit i can set the field to required="True".
But then it is required for both the selections. Is it possible to make a check with attr="" depending on the selection when its required or not?

Odoo 11 Community

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

Hi,

You can give required using the attributes like below,

<field name="test" attrs="{'required': [('selection_field_name','=', 'value')]}"/>

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ย. 24
1701
0
ก.พ. 21
15
1
ต.ค. 23
7916
0
ก.พ. 25
1487
0
ม.ค. 25
1246