Search code examples
odooodoo-8odoo-9odoo-10

Odoo10 strange warning


This is my code.

<span t-esc="o.amount_total * (o.type in 'out_refund' and -1 or 1)" t-esc-options='{"widget": monetary, "display_currency": o.currency_id}'/>

in Odoo10 i'm getting this warning

WARNING db odoo.addons.base.ir.ir_qweb.ir_qweb: Use new syntax for '<span t-esc="o.amount_total * (o.type in 'out_refund' and -1 or 1)" t-tag="span"/>
widget monetary
            ' monetary widget t-options (python dict instead of deprecated JSON syntax).

what is wrong with my code?


Solution

  • Try this out.

    Problem is you are giving options as json. but you need to pass it as python dictionary.

    <span t-esc="o.amount_total * (o.type in 'out_refund' and -1 or 1)" t-esc-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>