xml - 如何继承 qweb 报告模板并替换 odoo 中的元素
问题描述
我想在我的 payslip qweb 报告中替换 t 元素及其下的所有数据。那是 t 元素及其下的所有内容
<t t-call="web.internal_layout">
<div class="page">
<table class="table table-sm table-bordered">
............
</table>
</div>
</t>
我努力了
<template id="report_payslip_inherit_logo" inherit_id="hr_payroll.report_payslip">
<xpath expr="//t[1]" position="replace">
</xpath>
但它给出了一个不在视图中的错误。
解决方案
你可以直接给XPath
like t-call
this。代码:
<xpath expr="//t[@t-call='web.internal_layout']" position="replace">
<!-- Your Code -->
</xpath>
推荐阅读
- python - RuntimeError:在 Python 中使用 curve_fit
- angular - 如何构建特定的延迟加载角度模块
- node.js - 如何创建用于发布到 npm 的 ReactJS 包?
- python-3.x - UnicodeDecodeError:“utf-8”编解码器无法解码位置 15 中的字节 0x96:无效的起始字节
- vue.js - Vue - 如何在 Vue 组件中呈现 HTML
- java - 接口中的默认方法 - Java
- associations - cakephp 3 - 不可能用空列表生成条件
- typescript - Loopback4 多对多关系,但没有额外的 id 字段作为关系表中的主键
- linux - 在shell脚本中组合匹配的字符串和总和列
- google-apps-script - 我的脚本的项目属性中列出了额外的范围