0

代码:

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

1 回答 1

0

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

于 2015-07-31T08:32:10.000 回答