← Back to team overview

openerp-india team mailing list archive

[Bug 867449] Re: [6.0] report_webkit can't find the wkhtmltopdf binary automatically

 

Hello,

Well this point is all a story.

Summary of the long debate  in short:

-official addons can not embed compiled binary it may make anti viruses angry
-some people want to use a different version of binary than the one in the system for example the QT patched one
-walking path can be costly etc.

So in 6.1 we decided to put it as a server ir_config_parameter. If this
data is available it is used else it will look in the 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
"""

Your patch is follows the flow that has been taken in 6.1. But I'm not
sure it fits 6.0 commit policy.

To offer an alternate way we have coded the webkit_lib addons that embed
binary and use the good one depending on OS and architecture (32, 64).

Regards

Nicolas

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/867449

Title:
  [6.0] report_webkit can't find the wkhtmltopdf binary automatically

Status in OpenERP Addons (modules):
  New

Bug description:
  report_webkit ask you to configure the path for the wkhtmltopdf binary
  manually for each db, which can be a bit tedious, when it could
  automatically detect it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/867449/+subscriptions