【发布时间】:2017-12-26 11:33:48
【问题描述】:
我想要什么:
我想继承名为 report_invoice_document 的模型(account.invoice)qweb 报告,我通过购买->供应商账单然后打印供应商账单的发票。
到目前为止我做了什么
我正在尝试继承与模型 (account.invoice) 相关的 qweb 报告。我只需转到设置->报告并找到需要继承的我的 qweb 模板。这是屏幕截图。
我进一步深入研究我的报告。我已成功找到名为 account.report_invoice_document 的报告。这是屏幕截图
我已成功继承了所需的视图,它显示我曾尝试在继承的视图中继承然后视图。这是屏幕截图
这是我继承现有视图的代码。
<template id="myinherited_account_invoice_report" inherit_id="account.report_invoice_document">
<xpath expr="//table[@class='table table-condensed']/thead/tr/th[3]" position="after">
<th class="text-right">Analytic Account</th>
<th class="text-right">Analytic Tags</th>
</xpath>
<xpath expr="//table[@class='table table-condensed']/tbody/tr/td[3]" position="after">
<td class="text-right">testt1</td>
<td class="text-right">testt2</td>
</xpath>
</template>
这是我的 pdf qweb 报告,对我的工作没有影响。 这是我的 manifest.py
{
'name': "invoice_reports",
'summary': """
Inherit the qweb reports of Account.invoice""",
'description': """
Inherit the qweb reports of Account.invoice
""",
'author': "Hassan Ali(Dynexcel)",
'website': "http://www.dynexcel.com",
'category': 'Qweb',
'version': '0.1',
'depends': ['account'],
'data': [
'views/templates.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}
如果我在这里做错了什么,请指导我。因为我的相同代码在我的本地服务器上的 odoo 10C 上运行良好。但这并没有影响我的 odoo 11E。并指导我继承正确的 qweb 报告。
这里是公开回购。任何想查看完整代码的人都可以关注它。感谢您的宝贵时间。
【问题讨论】:
标签: inheritance odoo-10 qweb odoo-11