Odoo 10 - Qweb t-if t-else syntax

M.E. picture M.E. · Jan 3, 2018 · Viewed 16.6k times · Source

I do not know which is the right syntax for if-else in qweb.

<t t-if="origin != l.origin">
  <td>foo</td>
<t t-else/>
  <td>bar</td>
</t>

What is wrong here?

Answer

Juan Salcedo picture Juan Salcedo · Jan 3, 2018

You have to use <t t-else=""><td>bar</td></t>, take a look the documentation.