Help

4

How to configure webkit for V7

Avatar
ed

I want to configure webkit for the v7 version of openerp. I want to use a different logo in the webclient then in the reports.

I've installed the module but I can't seem to get it working.

In the company configuration I get a new tab webkit. I've added some new logo's but I can't seem to get it working any help ?

Avatar
Discard
8 Answers
10
Avatar
Yannick Vaucher
Best Answer

Installing webkit reports

Here are the base you need to know to be able to install webkit report in Odoo 7.0.

All modules can be found on http://apps.odoo.com or on https://github.com

Required branches

In 7.0 webkit engine is part of the official addons. module: Webkit Report Engine

However, for specific webkit reports you needs to get them from OCA community repository or from http://apps.odoo.com:

Here are the branches you will need to get to install all reports in Odoo 7.0

And you will also need the following branch to get the base headers:

  • Webkit Tools: OCA/webkit-tools
    Get it with: `git clone https://github.com/OCA/account-financial-reporting -b 7.0`
     

Webkit library

To install the required webkit library you can it get here: http://code.google.com/p/wkhtmltopdf/

If it is in your system path you won't need to configure your OpenERP to find it. Otherwise, you must specify the path as webkit_path in OpenERP system parameters under `Settings -> Customization -> Low Level Object -> System Parameters`.

Adding Logo

As an example, you will find a camptocamp_logo value in the default header. In `Setting -> Technical -> Webkit Logos`, you can add a new logos.

Headers edition

Headers are stored in `Setting -> Technical -> Webkit Headers/Footers` just under the Webkit Logos menu. You can change them there.

And then changing the line in your header will display your logo:

    <td>${helper.embed_logo_by_name('<your_logo_name_here>')|n}</td>

Use a specific header in a report

If you select headers, you can select the header used from your report in `Settings -> Technical -> Actions -> Reports` in tab Webkit.

Multi-company

In case of multi-company you can also set different headers per company. The Webkit Header field in your report is a property.

To define a header per company go in `Settings -> Technical -> Parameters -> Configuration Parameters` search for the webkit_header_default

Recreate the same parameter per company by specifying the Company field (Your user must be in group Multi Companies to see it). Plus replace the Base Sample value by the right header.

12 Comments
Avatar
Discard
Avatar
Davide Corio
-

oh, didn't know of lp:webkit-utils. thanks. soon we'll need a full map of community projects :)

Avatar
Camptocamp SA
-

I don't have a map but here might be a compas :) community teams If you go down in each team, you will see the related projects.

Avatar
Davide Corio
-
Avatar
ed
-

i'll check it out today !! thanks for the great explanation!!

Avatar
Daniel Reis
-

I think it would be important for this information to be included in the Webkit report module.

Avatar
Camptocamp SA
-

I just made, a little correction about where to find all Webkit Logos and Headers.

Avatar
Camptocamp SA
-

@Daniel Reis You are right, but be last time I tried to update the descriptor took ages, my last MP hasn't even been accepted yet. If I have time I'll make another MP

Avatar
Ahmad Khayyat
-

@Yannick I managed to install webkit reports on v7.0 and to create a sample (i.e. useless) report. I, however, was unable to get the financial reports community module (lp:account-financial-report/7.0) to produce any reports.

I filed a bug report here: https://bugs.launchpad.net/account-financial-report/+bug/1129867

Avatar
Camptocamp SA
-

Thank you for the bug report. Please see my comment on launchpad bug lp:1129867

Avatar
Camptocamp SA
-

Added some info about using headers in multi company

Avatar
Anabela Damas
-

Hi, I'm trying to put the image in the report, I was trying to do what you said but nothing happens where do I put this line :

<td>${helper.embed_logo_by_name('<your_logo_name_here>')|n}</td>

In my header I don't have nothing similar to this...

Avatar
Camptocamp SA
-

@Anabela Damas You will find this code in webkit headers installed with module . base_headers_webkit http://bazaar.launchpad.net/~webkit-utils-core-editors/webkit-utils/7.0/view/head:/base_headers_webkit/base_headers_data.xml.

You can use the same helper to add image in the body of your report. You aren't forced to use a <td> html balisis

14
Avatar
Thomas Dubois
Best Answer

Hey,

Thanks to Yannick's comments, I managed to get stuff installed. Here's how I did it. It's certainly not the best way, but at least my way :)

• Install bzr

apt-get install bzr

• Create an addons folder, I did it on /opt/openerp-custom

cd /opt/openerp-custom

mkdir sources

cd sources

bzr branch lp:account-invoice-report/7.0 account-invoice-report

bzr branch lp:sale-reports/7.0 sale-report

bzr branch lp:account-financial-report/7.0 account-financial-report

bzr branch lp:webkit-utils webkit-utils

cd ..

mkdir addons

cd addons

ln -s ../sources/sale-report/sale_order_webkit/ sale_order_webkit

ln -s ../sources/account-invoice-report/invoice_webkit/ invoice_webkit

ln -s ../sources/webkit-utils/base_headers_webkit/ base_headers_webkit

ln -s ../sources/webkit-utils/report_webkit_chapter_server/ report_webkit_chapter_server

(do the same for financial reports if you need them)

• Install wkhtml2pdf

Go to http://code.google.com/p/wkhtmltopdf/ and download the latest wkhtmltopdf (people were saying that the static version was best, forgot to note source, sorry)

cd

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2

bunzip2 wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2

tar -xvf wkhtmltopdf-0.11.0_rc1-static-i386.tar

mv wkhtmltopdf-i386 /usr/bin/wkhtmltopdf

• Update OpenERP configuration.

vi /etc/openerp/openerp-server.conf

add:

addons_path = /usr/lib/pymodules/python2.7/openerp/addons,/opt/openerp-custom/addons

(make sure your default addons_path is /usr/lib/pymodules/python2.7/openerp/addons. You can check that in the server log, the path is given on startup)

Restart OpenERP service openerp restart

• Go to web interface

Make sure your admin users has technical capabilities (else edit your user in Conf / Users, access rights tab and check "Technical features")

• Update modules list

Under Configuration / Modules, click "Update Modules list"

• Go to "Installed modules"

In the search bar, remove the "Installed" tag and search for "webkit" instead.

You should see the modules that are in /opt/openerp-custom/addons

Install them

• Test Go to Configuration Header/Footers for Webkit and edit "Base Reports Portrait Header"

Specify your company there.

Try to print a quote, cross fingers :)

• Customization

Edit headers and footers in Configuration / Header-Footers for Webkit

I edited the "Base Reports Portrait Header"

Edit templates in Configuration / Action / Reports. I edited sale.order

If you use custom fonts, add them to the system (I added them to /usr/share/fonts/truetype and ran fc-cache -fv )

Hope this will save someone some hours trying to find out how to install that :)

Best, Thomas

6 Comments
Avatar
Discard
Avatar
Camptocamp SA
-

@Thomas You don't need to add symlinks in addons folder, you can add branches by specifying the path in you config file under param named addons_path or with a command line option:

--addons-path=ADDONS_PATH specify additional addons paths (separated by commas).
Avatar
Thomas Dubois
-

@Yannick oops, yes, OpenERP. For symlinks, I didn't want to everytime edit the server config

Avatar
Kevin Shenk
-

This is one of the most thoroughly documented answers/tutorials I've come across. Thanks!!

Avatar
Kevin Shenk
-

You don't need to setup wkhtmltopdf if you use this ppa: launchpad.net/~trevor/+archive/wkhtmltopdf

Avatar
vivek
-

Hi, This was really useful Thomas and Yannik, Thank You for your good work

Avatar
Miguel Angel
-

bzr branch lp:webkit-utils webkit-utils --> bzr branch lp:webkit-utils/7.0 webkit-utils

1
Avatar
Fred Cruypennick
Best Answer

For those who got an issue like me with wkhtmltopdf from the openerp web interface (local command line is working fine btw), I was able to solve it by reinstalling an old version of it:

sudo wget "http"://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
sudo bunzip2 wkhtmltopdf-0.9.9-static-amd64.tar.bz2
sudo tar -xvf wkhtmltopdf-0.9.9-static-amd64.tar
sudo mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf

I use OpenERP 7 on ubuntu 12.04 64bits just remove the quotes between http (it's because of my basic karma on this forum)

Avatar
Discard
1
Avatar
Med Said BARA
Best Answer

Hi,

Wrong link for: Financial Reports: module account_financial_report_webkit in lp:account-financial-report/7.0

The good link: lp:account-financial-report/7.0

1 Comment
Avatar
Discard
Avatar
Yannick Vaucher
-

Thanks I fixed it while updating the answer with github repo

1
Avatar
Davide Corio
Best Answer

the report_webkit module doesn't install reports. this means you'll have to create your own reports or find and install reports made for webkit, like this one:

http://bazaar.launchpad.net/~camptocamp/c2c-rd-addons/7.0/files/head:/account_invoice_webkit/

1 Comment
Avatar
Discard
Avatar
Camptocamp SA
-

This branch doesn't contain the last version of account_invoice_webkit the module has been moved in lp:account-invoice-report/7.0

0
Avatar
LAKHSAM Khalid
Best Answer

Hi, I successed to install webkit on ubuntu 12.10/OP7 But I didn't for windows. Plz can someone give us the efficent method to install webkit on windows 7

3 Comments
Avatar
Discard
Avatar
Camptocamp SA
-

If you mean installing the library on Windows, you might create a new question

Avatar
Emad Sherbini
-

Hi, I have windows server 2003 Installed openerp 7 under : C:\Program Files (x86)\OpenERP 7.0 Installed wkhtmltopdf “wkhtmltox-0.11.0_rc1-installer.exe ”under : C:\Program Files (x86)\wkhtmltopdf Installed Financial Reports – Webkit v. 1.0 Under System Parameters add: Key : webkit_path Value : C:\Program Files (x86)\wkhtmltopdf

But when I run the General Ledger report I get the following error: coercing to Unicode: need string or buffer, bool found (<type 'exceptions.TypeError'>, TypeError('coercing to Unicode: need string or buffer, bool found',), <traceback object at 0x10A115A8>)

Avatar
Odoo
-

I am facing the same issue.....How to resolve this issue ...need a help from some one...............

0
Avatar
René
Best Answer

Hi, I tried to installed all webkit components as described in this thread, but it seems that webkit-headers available in lp:webkit-utils are not yet compatible with V7. Where can they be downloaded? René

3 Comments
Avatar
Discard
Avatar
Camptocamp SA
-

base_headers_webkit module was ported to v7.0 at revision 14 And by the way it is mainly a templates so nothing really changes between 6.1 and 7.0.

If there is a bug, please report it. If by non-compatible headers, you mean they aren't printed, you might not have the right wkhtmltopdf librairy version.

Avatar
Camptocamp SA
-

@René make sure you took lp:webkit-utils/7.0 branch not the lp:webkit-utils which leads to 6.1 version

Avatar
Kevin Shenk
-

@René please post your comment under the instructions you're referring to, don't start a new answer.

0
Avatar
Michael Karrer
Best Answer

Is this post still valid?

There has been another branch in Launchpad called lp:openerp-reporting-engines that seems to hold the utils now - is lp:webkit-utils/7.0 still needed at all?!?

1 Comment
Avatar
Discard
Avatar
Camptocamp SA
-

openerp-reporting-engine gather modules of type of reports that aren't in openerp core. Thus, for webkit base headers, you still need the ones in webkit-utils.