I remember touching on this solution during the OpenERP technical training at the OpenERP's HQ 'The Farm' in Belgium - so was quite looking forward to try this on my server installation. The OpenERP WebKit Module adds a new Report Engine based on WebKit library (wkhtmltopdf) to support reports designed in HTML + CSS. The module structure and some code is inspired by the report_openoffice module. The module allows:
This installation didn't go as smoothly as I expected. Not due to the OpenERP modules, but due to the fact my ERP server is running on a separate hardware (with amd64) and most of the documentation assumes your running the client and server on the same PC H/W with 32bit architecture. The issues I experience are now resolved as explained later. Version 7.0 Installation Guide:1. Install the openerp modulesInstall the webkit module /Settings/Modules/Modules These are the WebKit Modules to install: 2. Add a LogoAfter installing the webkit modules, Go to menu /Settings/Companies/Webkit Logos If you installed the webkit_sample module too, the you'll see a demo logo already installed. Press Create to make a new Logo You can upload you own company logo by pressing 'Create'. Add a name for this logo, the file type (e.g jpg) and associate it with a company. Then press the file icon to upload the image. Then press save : 4. Configuration of Company SettingsLeave the headers and footers as they are and go to menu /Settings/Companies/Companies and open the company master. What's very clever with this solution is that if you are running a multi-company installation, then each company can have a different report configuration i.e. a different logo, header, footer etc, which would normally be required. You'll see a new tab called 'Webkit' has been added to the company form. On this view you'll see the main configuration settings. The important part is the WebKit Executable Path i.e. the path where the executable program for converting HTLM to .pdf format is located. The program is called wkhtlmtopdf and needs to be installed on the server. If you are running Ubuntu on 32bit hardware then you should be able to install this with apt-get install wkhtmltojpg. and the program should be installed in /usr/bin/. (BTW: if you don't install this software the webkit will still work in debug mode, but will only produce html files) If you're running 64bit hardware then don't install it this way as this configuration didn't go as smoothly as I expected, as after installation I received a lot of error messages when trying to print a .pdf documet - (this is explained in more detail later). Not due to the OpenERP modules, but due to the fact my ERP server is running on a separate hardware (with amd64) and most of the documentation incorrectly assumed I was running the client and server on the same PC H/W with 32bit architecture. The issues I experience are now resolved after installing the correct version of WKHTMLTOJPG program. Here is a forum discussion where I found the hint to the resolution -> Forum Discussion-1 The discussion describes the same issue I encoutered with the installation. It was resovled by installing the latest Linux Static Binary for Amd64 machine. So if you are also using a 64bit server, don't use the software version that's installed from the general Ubuntu repositories, as these don't always have the latest versions i.e. don't use apt-get install wkhtmltojpg as the wrong version will be installed. Just down load the program from the webkit website (link below, but check for latest versions) WKHTMLTOJPG Application that needed to be installed: So after downloading / unzipping I moved the program into /user/bin manually. I also tested the following solution (intended for a Drupal installation) which did not work from within OpenERP -> http://drupal.org/node/870058 I could, however, run the script from the command line on the server. This could therefore have been a solution but the modules's Python code would need to be changed. (calling wkhtmltopdf.sh rather than wkhtmltopdf Add the logo and header / Footers that was created in the previous steps 2 & 3 Report ConfigurationIf you've installed the Webkit sample module, then go to menu /Setting/Customisation/Low Level Object/Actions/Report and you'll see a new report format created called WebKit Invoice. The output format field does not seem to have any influence so just leave it blank. The report Type is webkit. The report file is the template file of the document. More details on how to make this are explained later. Now you are ready for printing. There is a demo report that you can run which is available from the /Finance/Customers/Customer Invoices view. In the right hand menu you'll see a new menu open WebKit Invoice. Select an invoice and press the button to print. If all went well the .pdf document will print. Configuration of new ReportsThe main challenge with this solution is getting your head around MAKO files. You'll also need to understand Python. and creation of rml parsers to extract repeating child records, such as the BOM of a BOM component. But then all the other solutions I test, also required you get your head around programming. |
Welcome to BACON:CONSULT > Services > odoo > Business Intelligence and Printing Reports in OpenERP >