4

我尝试在发票报告中打印发票行。为了

<span t-field="l.price_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

并且对于

<span t-field="l.price_subtotal" />

有一个输出:“111.11 $”但我需要没有符号的行价格。

如果我做类似的东西

<span t-esc="round(l.price_total, 2)"/>

它有效,是的,但我失去了货币格式

  1. 有没有办法告诉货币小部件它不应该显示货币?

    "display_currency": "False" 不起作用 (

  2. 货币小部件代码在哪里?我在源文件中找不到它(

4

1 回答 1

4

试试这个从 qweb 中删除货币符号。带货币格式

<span t-esc="'{:,.2f}'.format(doc.price_subtotal)" >

或者这将在没有货币格式的情况下打印

<span t-field="doc.price_subtotal" t-field-options="{'widget':'False'}"/>
于 2018-01-18T06:48:07.523 回答