Odoo 基于条件的动态字符串

Odoo 基于条件的动态字符串,odoo,odoo-9,Odoo,Odoo 9,在qweb报告中,我有以下代码: 单价(美元)单价(美元) 金额(美元)金额(美元) 单价(欧元)单价(欧元) 金额(欧元)金额(欧元) 但是如何根据货币使字符串动态?这将允许您设置动态货币名称 您可以尝试以下方法: <th style="width: 12%;" class="text-right"> <t>Unit Price (<span t-field="o.currency_id.name"/>)</t><br/>

qweb
报告中,我有以下代码:


单价(美元)
单价(美元) 金额(美元)
金额(美元) 单价(欧元)
单价(欧元) 金额(欧元)
金额(欧元)

但是如何根据货币使字符串动态?

这将允许您设置动态货币名称<代码>

您可以尝试以下方法:

<th style="width: 12%;" class="text-right">
    <t>Unit Price (<span t-field="o.currency_id.name"/>)</t><br/>
    Unit Price (<span t-field="o.currency_id.name"/>)
</th>
<th style="width: 12%;" class="text-right">
    <t>Amount (<span t-field="o.currency_id.name"/>)</t><br/>
    Amount (<span t-field="o.currency_id.name"/>) <span t-esc="get_currency_codes()"/>
</th>

单价()
单价() 金额()
金额()
<th style="width: 12%;" class="text-right">
    <t>Unit Price (<span t-field="o.currency_id.name"/>)</t><br/>
    Unit Price (<span t-field="o.currency_id.name"/>)
</th>
<th style="width: 12%;" class="text-right">
    <t>Amount (<span t-field="o.currency_id.name"/>)</t><br/>
    Amount (<span t-field="o.currency_id.name"/>) <span t-esc="get_currency_codes()"/>
</th>