Reporting with WebKit? | Odoo

Reporting with WebKit?

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

Dale E. Moore
Dale E. Moore
403
| 5 2 8
Asked on 2/20/13, 2:15 PM
3
vote
6240 Views

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.

Dale E. Moore
Dale E. Moore
403
| 5 2 8
Answered On 2/20/13, 5:08 PM
2
vote

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
Daniel Reis
Daniel Reis
3067
| 6 7 9
Answered On 2/20/13, 3:22 PM
4
vote

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, 4:19 PM

where are no such option in new webkit versions.

tolstoj
on 2/20/13, 4:38 PM

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

Thibaut DIRLIK
Thibaut DIRLIK
160
| 4 3 4
Answered On 2/20/13, 4:50 PM
3
vote

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')
                    )
tolstoj
tolstoj
672
| 6 4 8
Answered On 2/20/13, 4:44 PM
2
vote

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

Moore Works, Dale E. Moore
on 2/20/13, 5:03 PM

webkit_report.py:75

tolstoj
on 2/20/13, 5:09 PM

In Odoo v8....Ubuntu 14.04

sudo apt-get install wkhtmltopdf

 

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

IvorJ
IvorJ
0
| 0 0 0
Answered On 8/6/14, 8:16 AM
0
vote

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.

Ask a Question

About This Forum

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


Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 2/20/13, 2:15 PM
Seen: 6240 times
Last updated: 8/6/14, 8:16 AM