跳至內容
選單
此問題已被標幟
2 回覆
7062 瀏覽次數

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

頭像
捨棄
作者 最佳答案

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

頭像
捨棄
最佳答案

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>

 

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
12月 17
3540
1
9月 17
5021
1
8月 16
16477
0
1月 16
3270
3
7月 15
3861