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

I need to make this (pre_sale_date) field mandatory only in stage ("ESCOPO") but because all the stages have the same ID I'm not working. This field I'm creating a new module on CRM

Link code XML --->
https://prnt.sc/iy0yc0

Link View Odoo --->
https://prnt.sc/iy10w5

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

Try this one

<field name="field1" attrs="{'required':[('make_that_field_required_when_your_stage_is_Department','=','Department')]}"/>
อวตาร
ละทิ้ง

You can use attrs attributes to make a field visible, invisible, read-only and required. For more detail please visit: http://learnopenerp.blogspot.com/2016/10/how-to-visible-and-invisible-fields-in.html

Hope this helps you and others :)

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

try:

<field name="pre_sale_date" position="attributes">
<attribute name="attrs">{'required': [(your_condition)]}</attribute>
</field>

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

what should I fill in (your_condition)? for this field is not mandatory in Estonian I would need an ID however by stage it is a field it does not have ID

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
6634
2
ธ.ค. 23
1286
0
มิ.ย. 22
1392
1
ต.ค. 19
4423
1
ก.ค. 17
5503