Skip to Content
Menu
This question has been flagged
2 Replies
6072 Views

Hi,
How can I create a QWeb report to show fields that are based on an inherited model

and how can I print it using a button

Avatar
Discard
Author Best Answer

I have this error now:

Traceback (most recent call last): File "/home/odoo8/workspace/Odoo8.0/openerp/addons/report/controllers/main.py", line 120, in report_download response = self.report_routes(reportname, converter='pdf', **dict(data)) File "/home/odoo8/workspace/Odoo8.0/openerp/http.py", line 410, in response_wrap response = f(*args, **kw) File "/home/odoo8/workspace/Odoo8.0/openerp/addons/report/controllers/main.py", line 65, in report_routes pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context) File "/home/odoo8/workspace/Odoo8.0/openerp/api.py", line 268, in wrapper return old_api(self, *args, **kwargs) File "/home/odoo8/workspace/Odoo8.0/openerp/addons/report/models/report.py", line 222, in get_pdf root = lxml.html.fromstring(html) File "/usr/lib/python2.7/dist-packages/lxml/html/__init__.py", line 704, in fromstring doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) File "/usr/lib/python2.7/dist-packages/lxml/html/__init__.py", line 603, in document_fromstring "Document is empty")ParserError: Document is empty

Avatar
Discard
Best Answer

create report in exiting model  in  create frist report directory and report directory   insite report file and add report file in menifes

example modalname_report.xml

1 create action in report 

     <report id="action_report_print_student"

model="personal.info" report_type="qweb-pdf"

string="Personal report" name="personal_info.report_personal_info" file="personal_info.report_personal_info" />

2 create template

<template id="report_personal_info">

<t t-call="report.html_container"> // custom or report (header and footer) template

<t t-foreach="docs" t-as="o">

<t t-call="report.external_layout">

<div class="page">

<p>Fullname: <span t-field="o.full_name"/> </div>

</div>

</t>

</t>

</t>

</template>

 

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 17
2872
1
Sep 17
4020
1
Aug 16
14879
0
Jan 16
2604
3
Jul 15
3075