代码:
<openerp>
<data>
<template id="report_saleorder_insurance_inherit" inherit_id="sale.report_saleorder_document">
<xpath expr="//div[@class='row']/div[@class='col-xs-4 pull-right']/table/tr[2]" position="after">
<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>
</xpath>
</template>
</data>
</openerp>
此代码应在销售订单成本中添加额外的一行,但更新后没有显示。我已将 xml 添加到__openerp__.py
文件中,然后重新启动了服务。模块更新没有任何错误。我不知道为什么它不起作用。我是不是忘记了什么?
xpath 应该在核心 xml 的这一部分内添加一行:(取自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>