This question has been flagged
5 Replies
18785 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

Avatar
Discard
Author Best Answer

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.

Avatar
Discard
Best Answer

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
Avatar
Discard
Author

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."

where are no such option in new webkit versions.

Best Answer

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

Avatar
Discard
Best Answer

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')
                    )
Avatar
Discard
Author

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

webkit_report.py:75

Best Answer

In Odoo v8....Ubuntu 14.04

sudo apt-get install wkhtmltopdf

 

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

Avatar
Discard