Академический Документы
Профессиональный Документы
Культура Документы
Seleccionar idioma ▼ Search
Call Us Free
Contact Form
Send Message
http://www.zbeanztech.com/blog/qweb-report 1/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
The template’s id must be the name specified in the report declaration; for
example account.report_invoice for the above report. Since this is a QWeb
template, you can access all the fields of the docs objects received by the
template. Calling external_layout will add the default header and footer on
http://www.zbeanztech.com/blog/qweb-report 2/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
your report. The PDF body will be the content inside the <div class="page">.
doc_ids
list of ids for the docs records
doc_model
model for the docs records
time
a reference to time from the Python standard library
translate_doc
a function to translate a part of a report.If you wish to translate reports (to
the language of a partner, for example), you need to define two templates:
The main report template
The translatable document
You can then call translate_doc from your main template to obtain the
translated document.
The name of the template id (from the first record) should be the same as
the name for the t-raw that handles translations. In the t-raw you need to
add the module name before this name with a dot. The main template calls
http://www.zbeanztech.com/blog/qweb-report 3/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
user
res.user record for the user printing the report
res_company
record for the current user‘s company
name (mandatory)
only useful as a mnemonic/description of the report when looking for one
RVICESin a list
CASE STUDIES
of some sort NEWS BLOGS CONTACT US
http://www.zbeanztech.com/blog/qweb-report 4/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
description
a small description of your format
format
dpi
output DPI; 90 by default
page_height, page_width
page dimensions in mm
orientation
Landscape or Portrait
header_line
boolean to display a header line
header_spacing
header spacing in mm
http://www.zbeanztech.com/blog/qweb-report 5/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
Parser Class:
To create parser class you need to import report_sxw.rml_parse.
The methods you want to access in report must be updated in localcontext
in parser class.
Create another class which which inherits features of osv.AbstractModel
and it creates bond between parser class and template engine.
This new class have few parameters and each of the parameters have fixed
pattern so must follow it.
_name = ‘report.<module_name>.<report_name>’
_inherit = ‘report.abstract_report’
_template = ‘<module_name>.<report_name>’
_wrapped_report_class = <parser_class_name>
reply
http://www.zbeanztech.com/blog/qweb-report 6/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
Thanks for the detailed information about Web Report. It is good and I like
the way you make this tutorial in the help of people looking for these
results. Also rating of essay services is good for the help and support of the
students.
reply
Thanks Anju,
This Post help me allot. I need some more explanation on the pdf report
development. I have an issue
https://www.odoo.com/forum/help-1/question/how-can-i-change-report-
file-...
reply
http://www.zbeanztech.com/blog/qweb-report 7/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
def print_report(self,cr,
datas = {
'ids': [data.get('id')],
'model': 'sale.order',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'sale.order.report',
'datas': datas,
'name': 'Quotation ' + self_browse[0].name
}
reply
reply
http://www.zbeanztech.com/blog/qweb-report 8/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
Hi,
Thank you.
reply
reply
reply
http://www.zbeanztech.com/blog/qweb-report 9/10
29/9/2015 QWeb Report in Odoo 8 | Zesty Beanz
Talk to u
Live Chat
Email Us
Good Support
http://www.zbeanztech.com/blog/qweb-report 10/10