这是我的代码。
<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}"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句