Welcome!

This community is for professionals and enthusiasts of our products and services.

Register
3

Reporting with WebKit?

By
Dale E. Moore
on 2/20/13, 8:15 AM7025 views

I'm getting the hint from lots of posts on the web that WebKit is the future of OpenERP reporting. Perhaps I've misunderstood that and I would appreciate any informed guidance you can provide.

I've struggled in a OpenERP 6.1.2 and Ubuntu 12.10 environment to get WebKit running with http://www.camptocamp.com/'s report_webkit and report_webkit_sample modules but am less than successful.

Running Accounting, Customer WebKit invoice seems a good place to start after installing c2c's modules, but; I get:

OpenERP Warning
Wkhtmltopdf library path is not set
Please install executable on your system (sudo apt-get install wkhtmltopdf) or download it from here: http://code.google.com/p/wkhtmltopdf/downloads/list and set the path in the ir.config_parameter with the webkit_path key.Minimal version is 0.9.9

Some research and "apt-get install wkhtmltopdf" seems to be the thing to do, but; I encounter a different issue:

OpenERP Warning
2
No such file or directory
(<type 'exceptions.IOError'>, IOError(2, 'No such file or directory'), <traceback object at 0xb57b216c>)

Google implies "apt-get remove wkhtmltopdf" then installing a more current wkhtmltopdf will fix that issue (https://bugs.launchpad.net/openobject-addons/+bug/942679/comments/16.)

tar xvjf wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf

But I seem to be going around in circles:

OpenERP Warning
Wkhtmltopdf library path is not set
Please install executable on your system (sudo apt-get install wkhtmltopdf) or download it from here: http://code.google.com/p/wkhtmltopdf/downloads/list and set the path in the ir.config_parameter with the webkit_path key.Minimal version is 0.9.9

I'm even having problems accessing c2c's training movie http://files.me.com/nbessi/06n92k.mov. Their domain files.me.com resolves to https://www.icloud.com/ where I struggle with Apple to get access in my Linux environment because iCloud needs to be installed and functional for access. I give up and move down to Windows to find, I think, that Apple refuses access to gMail accounts; so, I move over to my Yahoo mail account, get a little further until iCloud reports I must have it enabled on an iPhone or OS X device before allowed in...

I'm thinking reporting might not be the thing for me, but; I'm hoping you set me straight, Dale


2
Dale E. Moore
On 2/20/13, 11:08 AM

Thanks to all whom contributed comments and answers; though, none completely solved the issue. Here's what worked:

apt-get remove wkhtmltopdf 
tar xvjf wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf

Logged into your OpenERP DB go to: Settings -> Customization -> Low Level Objects -> System parameter, define a key named webkit_path and set the value to /usr/local/bin/wkhtmltopdf.



4
Daniel Reis
On 2/20/13, 9:22 AM

You need to set the path for wkhtmltopdf in the Company settings:

image description

To find out what this path is in a unix box:

$ which wkhtmltopdf

In my case it prints:

/usr/bin/wkhtmltopdf

At Settings, Companies, Company, WebKit tab I have Images and Headers. Add images gets me to "Add: ir.header_img" where the camptocamp.logo is, and headers gets me to "Add: ir.header_webkit" where "Base Sample" is. Neither of these gets me (that I've found) to "Webkit Executable Path."

Moore Works, Dale E. Moore
on 2/20/13, 10:19 AM

where are no such option in new webkit versions.

tolstoj
on 2/20/13, 10:38 AM

3
Thibaut DIRLIK
On 2/20/13, 10:50 AM

In new webkit versions, you have to go to : Settings -> Customization -> Low Level Objects -> System parameter and define a key named webkit_path and set the full path of the executable in the value.

image description



2
tolstoj
On 2/20/13, 10:44 AM

Look at this function. try to debug and find why it cant find wkhtmltopdf path.

def get_lib(self, cursor, uid):
    """Return the lib wkhtml path"""
    proxy = self.pool.get('ir.config_parameter')
    webkit_path = proxy.get_param(cursor, uid, 'webkit_path')

    if not webkit_path:
        try:
            defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
            if hasattr(sys, 'frozen'):
                defpath.append(os.getcwd())
                if tools.config['root_path']:
                    defpath.append(os.path.dirname(tools.config['root_path']))
            webkit_path = tools.which('wkhtmltopdf', path=os.pathsep.join(defpath))
        except IOError:
            webkit_path = None

    if webkit_path:
        return webkit_path

    raise except_osv(
                     _('Wkhtmltopdf library path is not set'),
                     _('Please install executable on your system' \
                     ' (sudo apt-get install wkhtmltopdf) or download it from here:' \
                     ' http://code.google.com/p/wkhtmltopdf/downloads/list and set the' \
                     ' path in the ir.config_parameter with the webkit_path key.' \
                     'Minimal version is 0.9.9')
                    )

Interesting approach @tolstoj; where did you get that code from?

Moore Works, Dale E. Moore
on 2/20/13, 11:03 AM

webkit_report.py:75

tolstoj
on 2/20/13, 11:09 AM

0
IvorJ
On 8/6/14, 2:16 AM

In Odoo v8....Ubuntu 14.04

sudo apt-get install wkhtmltopdf

 

Then follow advice from Thibaut above. However, its Settings-Parameter-System Parameters


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 2/20/13, 8:15 AM
Seen: 7025 times
Last updated: 3/16/15, 8:10 AM