odoo - xpath 未显示

odoo - xpath not shown

代码:

<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>

尝试创建一个新的销售订单并打印它。一些报告保存在数据库中(在 ir_attachment table 中)。第一次打印报告后,Odoo 从数据库中恢复第一次打印的报告,你看不到变化