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

I was trying to implement an if-then-else with q-web span and I realize that: 

<t t-if="company.rpt_rbox_contactinfo" >
  <span t-field="doc.partner_id" t-field-options="...option specs #1..."/>
</t>
<t t-if="not company.rpt_rbox_contactinfo" >
<span t-field="doc.partner_id" t-field-options="...option specs #2..."/>
</t>

was not the same that: (this one doesn't work)

<span t-if="company.rpt_rbox_contactinfo" t-field="doc.partner_id" t-field-options="...option specs #1..."/>
<span t-if="not company.rpt_rbox_contactinfo" t-field="doc.partner_id" t-field-options="...option specs #2..."/>

This works instead:

<span t-if="company.rpt_rbox_contactinfo == true" t-field="doc.partner_id" t-field-options="...option specs #1..."/>
<span t-if="company.rpt_rbox_contactinfo == false" t-field="doc.partner_id" t-field-options="...option specs #2..."/>

Does anybody knows why ?

I'm using v9. Is this also the v8 behaviour ?

According to the section "conditionals" of:

https://www.odoo.com/documentation/9.0/reference/qweb.html

That should be the same.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 24
929
1
มี.ค. 15
20358
0
มิ.ย. 24
17
4
มิ.ย. 18
47558
1
พ.ค. 25
631