【发布时间】:2020-06-23 04:25:33
【问题描述】:
我正在用 Odoo 开发一个 Qweb 报告,我需要使用 xpath 表达式来替换一些内容。
这是替换内容所需的主要模板:
<template id="report_saleorder2_template">
<t t-name="report_saleorder2_template">
<t t-call="web.external_layout">
<div class="page">
<div class="oe_structure" />
<div class="row" id="report_data_0">
<h1>Annual voluntary contribution to Fecoas - Alcaste school</h1>
//more code
这是我要使用 xpath 表达式替换内容的另一个模板:
<template id="report_saleorder3_template">
<t t-name="report_saleorder3_template">
<t t-call="custom_v12_reports.report_saleorder2_template" t-lang="doc.partner_id.lang" />
<xpath expr="//div[@id='report_data_0']/h1[1]" position="replace">
<h1>Annual AMPA's member fee Alcaste school</h1>
</xpath>
</t>
</t>
</template>
这不起作用。有人知道为什么吗?
感谢阅读!
【问题讨论】: