Odoo Help


How do I start using WebKit reports?

Torvald B. Bringsvor
on 10/5/13, 7:48 PM 10,381 views

As the OpenOffice plugin seems to be both unmaintaned and broken, I'm looking for alternatives. And, at least if I am to limit myself to the SaaS offer, there seems to be only WebKit.

But documentation seems to be hidden away somewhere, do any of you have any info on how to start out with WebKit, for example to customize a payslip or invoice?

I want to know too.

Abdullah Sofan
on 10/5/13, 8:12 PM

I advise you to simply learn RML, it's simple once you get the hang of it, here is their full guide: www.reportlab.com/docs/rml2pdf-userguide.pdf‎.

IBS Group
on 10/6/13, 2:12 PM

The openoffice plug-in works, but you need an older openoffice version. Try 3.4.1 or 3.3.0. Iirc, 3.4.1 works here.

Roel Adriaans
on 10/7/13, 11:09 PM

Timo Talvitie, Vizucom Oy

--Timo Talvitie, Vizucom Oy--
| 5 4 7
Tampere, Finland
--Timo Talvitie, Vizucom Oy--

Lead developer at Vizucom.

Timo Talvitie, Vizucom Oy
On 10/6/13, 11:36 AM

I recommend that you start out with some simple community module that utilizes webkit reports. I personally like the sale_order_webkit by camptocamp, it's downloadable at https://www.openerp.com/apps/trunk/sale_order_webkit/

Here's a quick rundown of the basics of the module contents.


Make note of the required dependencies, report_webkit and base_headers_webkit. The former is the core module that makes using webkit reports possible in the first place. The latter provides some headers for your reports (header usually includes the client name, company name and logo, shipping address etc). It basically puts reusable header templates to the database so they can be utilized by your reports. You can also make your own headers, so installing that module is not mandatory, but it is good for getting started.


The <report> item tells OpenERP about your new report. Its Model attribute defines what type of object your report is handling, e.g. sale.order, account.invoice... The menu item that the user clicks to see the actual report will be shown in the Print menu when you are viewing objects of that type, and the text for that menu item is defined by the String attribute. With the id attribute you can override an existing report in a menu, e.g. a sale order RML report defined by the sale module.

The file attribute is perhaps the most important, as it defines the path to the mako file that is actually used to render your report. Also, don't forget to set the report_type to webkit.

webkit_header defines the used header in module.header_name notation (e.g. my_module.basic_portrait). You can view all available headers by going to the Settings -> Technical -> Webkit headers/footers menu in OpenERP. If you installed the base_headers_webkit module, you should see some options available there.


The report template itself. The mako files enable you to format the report with html and css, and you can still access all your OpenERP objects with inline python code. You can read more about the mako syntax at http://www.makotemplates.org/ but if you're already familiar with html and python, a good part of it should be pretty self-explanatory.


The report is registered at the bottom of the file with report_sxw.report_sxw, and if needed you can also use the localcontext.update function to give the mako template access to some data calculated by your python functions, e.g. calculating discounts for special customers. But for getting started and making a basic report there is very little you need to do in this file.

Also, you need to install wkhtmltopdf in your operating system to get the PDF reports generated, but if you're using the SaaS version I imagine that has been taken care of for you already.

That's a quick overview that will hopefully get you started. The webkit reports are a really convenient tool once you get past the initial learning curve.


IBS Group

--IBS Group--
| 4 6 8
Tetouan, Morocco
--IBS Group--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS Group
On 10/6/13, 2:18 PM

I advise you to simply learn RML and write the reports yourself instead of using OpenOffice

The reason is because webkit has some limitations that are crucial to reports, such as repeating table headers/footers (*) which is easily achievable in RML

(*): https://bugs.webkit.org/show_bug.cgi?id=17205

Over all, RML is very easy once you get the hang of it, here is their full guide: http://www.reportlab.com/docs/rml2pdf-userguide.pdf‎

Plus, writing RML code yourself is easier than using OpenOffice because it gives you more flexibility on what structure you want to achieve.

Yeah, I think I'll have a go with RML. A bit strange that OpenERP themselves seems to discourage it, but provide no real alternative IMHO. But it seems I'll stay on hosting my own OpenERP instance, since the edit-RML module is not available in SaaS, and you can't install your own modules either.

Torvald Baade Bringsvor, Torvald B. Bringsvor
on 10/7/13, 7:04 PM

Do anyone knows how to email these webkit reports through email to the partner? For example Partner Ledger Report? Or can anyone help in writing a template for it. I tried but i want to save the report to attachment in database, with the 'partner_name.pdf' filename. Please help its really urgent.

on 10/9/13, 7:26 AM

thx very much i think you are right

on 1/22/14, 6:08 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 10/5/13, 7:48 PM
Seen: 10381 times
Last updated: 9/24/15, 12:35 AM