Ask Your Question
3

Reporting with WebKit?

asked 2013-02-20 13:15:45 +0200

Dale E. Moore gravatar image Dale E. Moore flag of United States
360 4 14 27
http://MooreWorks.Net/

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

delete close flag offensive retag edit

4 Answers

Sort by » oldest newest most voted
1

answered 2013-02-20 16:08:27 +0200

Dale E. Moore gravatar image Dale E. Moore flag of United States
360 4 14 27
http://MooreWorks.Net/

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.

link publish delete flag offensive edit
3

answered 2013-02-20 14:22:33 +0200

Daniel Reis gravatar image Daniel Reis flag of Portugal
2817 5 22 31
http://openerpmanagements...

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
link publish delete flag offensive edit

Comments

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

Dale E. Moore ( 2013-02-20 15:19:00 +0200 )edit

where are no such option in new webkit versions.

tolstoj ( 2013-02-20 15:38:51 +0200 )edit
3

answered 2013-02-20 15:50:52 +0200

Thibaut DIRLIK gravatar image Thibaut DIRLIK
146 1 3 7

updated 2013-02-20 15:54:17 +0200

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

link publish delete flag offensive edit
2

answered 2013-02-20 15:44:36 +0200

tolstoj gravatar image tolstoj flag of Russian Federation
467 1 4 15
http://ussr.su/

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')
                    )
link publish delete flag offensive edit

Comments

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

Dale E. Moore ( 2013-02-20 16:03:21 +0200 )edit

webkit_report.py:75

tolstoj ( 2013-02-20 16:09:52 +0200 )edit

Login/Signup to Answer

Documentation

You can download ebooks on Facebook or buy paper book

You can read the online documentation

Question tools

Follow
2 followers

subscribe to rss feed

Stats

Asked: 2013-02-20 13:15:45 +0200

Seen: 2,488 times

Last updated: Feb 20 '13