【发布时间】:2015-10-21 13:26:46
【问题描述】:
代码:
<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>
【问题讨论】:
-
我试过你的 xpath,它工作正常。确保您正在更新模块
-
我确实更新了模块(甚至重新安装了它),当我检查模块的技术数据时,它显示视图已创建,但由于某种原因,销售订单页面上仍然没有显示任何内容。
-
尝试创建一个新的销售订单并打印它。一些报告保存在数据库中(在
ir_attachment表中)。第一次打印报告后,Odoo 从数据库中恢复第一次打印的报告,您看不到更改 -
不客气!我写了我的评论作为答案。你能把它标记为正确答案吗?谢谢! :-)
标签: xml xpath odoo odoo-8 qweb