无法继承account.invoice Qweb报告Odoo 11E

时间:2017-12-26 11:33:49

标签: inheritance odoo-10 qweb odoo-11

  

我想要的是什么:

我想继承名为report_invoice_document的模型(account.invoice)qweb报告,我可以通过Purchase-> Vendor Bills访问,然后打印供应商账单的发票。

  

到目前为止我做了什么

我正在尝试继承与模型(account.invoice)相关的qweb报告。我只是去设置 - >报告,找到了我需要继承的qweb模板。这是截屏。 enter image description here

我进一步深入研究报告。我已成功找到名为account.report_invoice_document的报告。这是截图 enter image description here

我已成功继承了我所需的视图,它向我显示我曾尝试继承继承视图中的视图。这是截图 enter image description here

这是我的代码,其中我继承了现有的视图。

 <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报告,对我的工作没有任何影响。 enter image description here 这是我的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报告。

这里是公共回购。任何人都想看到完整的代码然后请关注它。谢谢你的时间。

1 个答案:

答案 0 :(得分:0)

我看不出有什么不对劲。您开发了一个模块来继承报告?也许缺少对帐户模块的依赖。您是否尝试按名称继承而不是按类继承?

<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[3]" position="after">
相关问题