0

What i want:

I want to inherit the model(account.invoice) qweb report named as report_invoice_document which i access by Purchase->Vendor Bills then Print invoice of Vendor Bills.

What i had done till now

I am trying to inherit a qweb Report which relates to model (account.invoice). I simply goes to settings->reports and found my qweb template which need to be inherited. Here is the screenshoot. enter image description here

Further i dig into my reports. I had successfully found my report named as account.report_invoice_document. here is the screenshot enter image description here

I had successfully inherited my required view and it shows me that i had tried to inherit then view in inherited views. here is the screenshot enter image description here

here is my code in which i had inherited the existing view.

 <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>

here is my pdf qweb report that has no effect of my work. enter image description here here is my 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',
    ],
}

Please guide me if i am doing something wrong here. Because my same code works well at odoo 10C at my local server. But it didn't affect my odoo 11E. And also guide that do i inheriting the correct qweb report.

here is public repo. Anyone wanna see full code then please have an eye on it. Thanks for your time.

Community
  • 1
  • 1
Hassan ALi
  • 1,313
  • 1
  • 23
  • 51

1 Answers1

0

I cant see anything wrong. You develop a module to inherit the report? Maybe the dependency on account module in missing. Did you try to inherit by name instead by class?

<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[3]" position="after">
Sorginah
  • 112
  • 11
  • I had added the account as dependency – Hassan ALi Dec 26 '17 at 17:11
  • the xml is added in __manifest__.py? 'data': [ 'views/your_xml_file.xml', ] – Sorginah Dec 26 '17 at 19:20
  • Please have an eye again on question because i had updated the question and added the manifest.py – Hassan ALi Dec 27 '17 at 04:54
  • Im not sure what is going on. Maybe you should add purchase too as dependency because you are print the invoice from Purchase menu. When you install the module your view is loading? It is show in the log? – Sorginah Dec 27 '17 at 07:47
  • So, you try to add the dependency on purchase, inherit by name and it's show on the log that the view is installed, right? Did you try to install it in an empty odoo instance? Or with absolute path instead of relative path? The module is upload in a public repo? – Sorginah Dec 27 '17 at 12:23
  • just create one new invoice (dont duplicate) and then try to print report. or in report action make attachment="False" – Alpesh Valaki Dec 27 '17 at 13:40
  • https://github.com/LeaderMalang/Odoo-modules here is public repo please install and have any eye on it. But I am not able to pay for your time. – Hassan ALi Dec 27 '17 at 15:30
  • I will test it today. But you try everything I tell you before, right? – Sorginah Dec 28 '17 at 09:11