【发布时间】:2015-07-29 14:58:54
【问题描述】:
我正在尝试在销售订单中的总未税成本和总税费之间添加一个额外的行。在查看report_saleorder.xml 时,应在以下代码中添加我的行:
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total Without Taxes</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-right">
<span t-field="o.amount_tax"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</table>
</div>
</div>
由于编辑核心 xml 不是一个选项,我想知道是否可以使用 <xpath> 执行此操作,但我不确定如何执行此操作。我已经在我的 sale.py 文件中创建了一个 field 并查看他们的代码,我的 xml 应该类似于
<tr>
<td>Insurance</td>
<td class="text-right">
<span t-field="o.amount_insurance" t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
任何关于我如何能够做到这一点的帮助将不胜感激
【问题讨论】: