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.