Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
7013 Vistas

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
Descartar
Autor Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 17
3500
1
sept 17
4965
1
ago 16
16394
0
ene 16
3246
3
jul 15
3827