Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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 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.
<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.
I advise you to simply learn
RML and write the reports yourself instead of using
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 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.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/5/13, 7:48 PM|
|Seen: 10060 times|
|Last updated: 9/24/15, 12:35 AM|