pythonxmlodooqwebkitqwebpage

Report with qweb template in Odoo version 8


I want to know about QWeb Report in Odoo 8. In version 6 and 7, I used jasper_report... it's OK for me. But... now version 8, I can't find jasper_report for this version. In version 8, they used qweb template report.. I don't know how to use. I want to customize account_invoice report. That's why... I created view folder & I added report_account_extend.xml. I didn't change anything in report_account.xml file, just change name report_account_extend.xml. And then I added account_report.xml file for declare, just change id, string, name and file just like this:

id="account_invoices_extend"
string="Invoices Extend"
name="report_invoice_extend"
file="report_invoice_extend"

I printed this report from 'Customer Invoices' form, it's raised error:

 File "/home/erp/Odoo/prjoject/odoo/openerp/tools/cache.py", line 119, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/home/erp/Odoo/prjoject/odoo/openerp/addons/base/ir/ir_ui_view.py", line 848, in read_template
    raise ValueError('Invalid template id: %r' % (xml_id,))
QWebTemplateNotFound: Invalid template id: u'report_invoice_extend'

I want to know how to solve this error and how to create sample qweb template report. Is Qweb template xml file in view folder? Where is the related python file for this?

If you don't mind, please explain me step by step. Thanks


Solution

  • I ran into this "QWebTemplateNotFound: Invalid template id" problem. The way I solved it was by namespacing the template id. I am guessing 'report_invoice_extend' is the id of the template, so you need to prefix it with your modulename (where your modulename is the name of the folder). So it'll be:

    modulename.report_invoice_extend
    

    Hope this helps!