报告由于 Xpath 而缺少翻译
Report missing translation because of Xpath
原始报告是这个,我想用我的新报告覆盖它。
<openerp>
<data>
<template id="report_invoice_qweb">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
<div class="page">
<div>
我尝试使用
<data>
<template id="report_invoice_inherit" inherit_id="account.report_invoice_qweb">
<xpath expr="div[@class='page']" position="replace">
但是我的新报告没有翻译的问题。因为它不见了
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
我该如何解决这个问题。
行 <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
仍在 report_invoice_qweb
中,您没有修改或删除它,所以我想这不是问题所在。我的意思是,在您修改之后,新的帐户报告将是这样的:
<openerp>
<data>
<template id="report_invoice_qweb">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
<div class="page"> <!-- (YOUR CUSTOM div class="page") -->
... your code ...
</div>
</template>
</data>
</openerp>
我认为问题在于您尚未将模块的翻译导出为您的语言,并且 <div class="page">
的新内容尚未翻译。
所以解决方案是 设置 > 翻译 > 导入/导出 > 导出翻译,选择你的模块和语言并编辑生成的 .po
文件(或.csv
) 翻译您添加的术语。
原始报告是这个,我想用我的新报告覆盖它。
<openerp>
<data>
<template id="report_invoice_qweb">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
<div class="page">
<div>
我尝试使用
<data>
<template id="report_invoice_inherit" inherit_id="account.report_invoice_qweb">
<xpath expr="div[@class='page']" position="replace">
但是我的新报告没有翻译的问题。因为它不见了
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
我该如何解决这个问题。
行 <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
仍在 report_invoice_qweb
中,您没有修改或删除它,所以我想这不是问题所在。我的意思是,在您修改之后,新的帐户报告将是这样的:
<openerp>
<data>
<template id="report_invoice_qweb">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
<div class="page"> <!-- (YOUR CUSTOM div class="page") -->
... your code ...
</div>
</template>
</data>
</openerp>
我认为问题在于您尚未将模块的翻译导出为您的语言,并且 <div class="page">
的新内容尚未翻译。
所以解决方案是 设置 > 翻译 > 导入/导出 > 导出翻译,选择你的模块和语言并编辑生成的 .po
文件(或.csv
) 翻译您添加的术语。