Openerp Odoo10奇怪的警告

Openerp Odoo10奇怪的警告,openerp,odoo-8,odoo-9,odoo-10,Openerp,Odoo 8,Odoo 9,Odoo 10,这是我的密码 <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}'/> 在Odoo10中,我收到了这个警告 WARNING db odoo.addons.base.ir.ir_qweb.ir_qweb: Use new syntax for '<sp

这是我的密码

<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}'/>

在Odoo10中,我收到了这个警告

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).
WARNING db odoo.addons.base.ir.ir_qweb.ir_qweb:为'
小部件货币
'货币小部件t-options(python dict而不是不推荐的JSON语法)。
我的代码有什么问题吗?

试试这个

问题是您正在以json的形式提供选项。但您需要将其作为python字典传递

<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}"/>

您直接提供JSON值,并尝试将其转换为列表或字典形式的python格式