Odoo10奇怪的警告
Odoo10 strange warning
这是我的代码。
<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).
我的代码有什么问题?
试试这个。
问题是您提供的选项为 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 格式
这是我的代码。
<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).
我的代码有什么问题?
试试这个。
问题是您提供的选项为 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 格式