Edi Santoso
Odoo and Python Developer
drink a tea to enjoying the life

Odoo Qweb t-if compare date

 Qweb compare date using t-if


                                <td style="font-size:19px;padding:4px;width: 13%;">

                                    <t t-if="(datetime.datetime.strptime(o.date_invoice, '%Y-%m-%d') &lt;= datetime.datetime.strptime('2022-03-31', '%Y-%m-%d'))">

                                        PPN 10%

                                    </t>

                                    <t t-if="(datetime.datetime.strptime(o.date_invoice, '%Y-%m-%d') &gt; datetime.datetime.strptime('2022-03-31', '%Y-%m-%d'))">

                                        PPN 11%

                                    </t>

                                </td>